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

@pierlon pierlon 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.

@gziolo gziolo added [Type] Build Tooling Issues or PRs related to build tooling [Type] Bug An existing feature does not function as intended labels Aug 13, 2019
@talldan talldan added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Aug 14, 2019
Copy link
Member

@pablinos pablinos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@gziolo gziolo merged commit 7eb4aca into WordPress:master Aug 30, 2019
@gziolo gziolo added this to the Gutenberg 6.5 milestone Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants