Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a constant namespace for module sourcemaps #17024

Merged
merged 1 commit into from Aug 30, 2019

Conversation

@pierlon
Copy link
Contributor

commented Aug 13, 2019

Description

At the moment, sourcemap namespaces are generated with the value from output.library, which becomes: webpack://wp.[name]. Firefox is unable to retrieve the sourcemaps because it is an invalid URL, for example:

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

This PR sets the namespace to wp, so the URL becomes webpack://wp

N.B.: Chrome is not affected.

Copy link

left a comment

I'm not sure if there are other implications with this change, but I was having the same issue with Firefox, and I can confirm that this fixes it. The source maps are also still loaded by Chrome as expected.

@gziolo
gziolo approved these changes Aug 30, 2019
Copy link
Member

left a comment

I can confirm it works with Chrome and Firefox as advertised. It still doesn't work with Safari though.

@gziolo
gziolo approved these changes Aug 30, 2019
Copy link
Member

left a comment

@pierlon, thank you for your first code contribution, this improvement is much appreciated 🙇

@gziolo gziolo merged commit 7eb4aca into WordPress:master Aug 30, 2019
16 checks passed
16 checks passed
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Filter opened
Details
Milestone It
Details
Milestone It
Details
Milestone It
Details
Milestone It
Details
Milestone It
Details
Travis CI - Pull Request Build Passed
Details
@gziolo gziolo added this to the Gutenberg 6.5 milestone Aug 30, 2019
dd32 pushed a commit to dd32/gutenberg that referenced this pull request Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.