[wp-trac] [WordPress Trac] #47870: Unable to load source maps from webpack in Firefox
WordPress Trac
noreply at wordpress.org
Tue Aug 13 17:00:09 UTC 2019
#47870: Unable to load source maps from webpack in Firefox
--------------------------+------------------------------------
Reporter: pierlo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords: has-patch dev-feedback
Focuses: javascript |
--------------------------+------------------------------------
By default, Webpack uses `output.library` as the namespace for module
source maps, which generates the URL `webpack://wp.[name]/<path of
module>`. This loads fine in Chrome, but in Firefox it throws an error
similar to:
Source map error: TypeError: Invalid URL:
webpack://wp.[name]/webpack/bootstrap
Resource URL: http://localhost:8888/wp-
content/plugins/gutenberg/build/components/index.js?ver=1565639281
Source Map URL: index.js.map
The solution to this is to specify a
[https://webpack.js.org/configuration/output/#outputdevtoolnamespace
devtoolNamespace].
So for example, setting `devtoolNamespace`to `wp` would result in the URL
`webpack://wp/<path of module>` (which the attached patch does).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47870>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list