简体   繁体   English

来源 map 错误:错误:无效的 URL 如何解决?

[英]Source map error: Error: Invalid URL how to fix it?

I have next.js app using chakra ui styles.我有使用脉轮 ui styles 的 next.js 应用程序。 Its movie app and its fetching images from movie db.它的电影应用程序及其从电影数据库中获取图像。 When i open my site before image load I can see only ulr text for this img then after 1s image laodes.当我在图像加载之前打开我的网站时,我只能看到这个 img 的 ulr 文本,然后在 1s 图像 laodes 之后。 How to prevent this?如何防止这种情况?

And i get that error form firefox:我从 firefox 得到那个错误:

Source map error: Error: Invalid URL: webpack://[name]_[chunkhash]/webpack/bootstrap Resource URL: http://127.0.0.1:3001/_next/static/development/dll/dll_01ec57fc9b90d43b98a8.js?ts=1574263926643 Source Map URL: dll_01ec57fc9b90d43b98a8.js.map Source map error: Error: Invalid URL: webpack://[name]_[chunkhash]/webpack/bootstrap Resource URL: http://127.0.0.1:3001/_next/static/development/dll/dll_01ec57fc9b90d43b98a8.js?ts = 1574263926643来源 Map URL:dll_01ec57fc9b90d43b98a8.js.Z1D78DC8ED51214E51AEFEZ5114

I had the same error and found out that there seems to be a bug concerning source maps and Firefox:我有同样的错误,发现似乎有一个关于源映射和 Firefox 的错误:

https://github.com/vercel/next.js/issues/9471 https://github.com/vercel/next.js/issues/9471

Chrome does not show this problem... Chrome 没有显示这个问题...

Try to config output.devtoolNamespace .尝试配置output.devtoolNamespace

This option determines the modules namespace used with the output.devtoolModuleFilenameTemplate.此选项确定与 output.devtoolModuleFilenameTemplate 一起使用的模块命名空间。 When not specified, it will default to the value of: output.library.未指定时,默认值为:output.library。 It's used to prevent source file path collisions in sourcemaps when loading multiple libraries built with webpack.它用于在加载使用 webpack 构建的多个库时防止源映射中的源文件路径冲突。

If you use firefox to debug, you'd better config output.devtoolModuleFilenameTemplate to use http:// instead of webpack:// . If you use firefox to debug, you'd better config output.devtoolModuleFilenameTemplate to use http:// instead of webpack:// .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM