WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 6 days ago

Last modified 6 days ago

#47870 closed defect (bug) (fixed)

Unable to load source maps from webpack in Firefox

Reported by: pierlo Owned by: adamsilverstein
Milestone: 5.3 Priority: normal
Severity: normal Version: trunk
Component: Build/Test Tools Keywords: has-patch dev-feedback commit
Focuses: javascript Cc:

Description

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 devtoolNamespace.

So for example, setting devtoolNamespaceto wp would result in the URL webpack://wp/<path of module> (which the attached patch does).

Attachments (1)

namespace.patch (442 bytes) - added by pierlo 6 weeks ago.

Download all attachments as: .zip

Change History (10)

@pierlo
6 weeks ago

#1 @SergeyBiryukov
6 weeks ago

  • Component changed from General to Build/Test Tools

#2 follow-up: @andraganescu
5 weeks ago

I have tested this patch and Firefox still report the same error. Am I doing something wrong @pierlo ?

#3 in reply to: ↑ 2 @pierlo
5 weeks ago

Replying to andraganescu:

I have tested this patch and Firefox still report the same error. Am I doing something wrong @pierlo ?

It still works on the latest version of trunk. Maybe you have cache issues?

This ticket was mentioned in Slack in #core-js by pierlo. View the logs.


5 weeks ago

This ticket was mentioned in Slack in #core-js by pierlo. View the logs.


6 days ago

#6 @adamsilverstein
6 days ago

  • Owner set to adamsilverstein
  • Status changed from new to assigned

#7 @adamsilverstein
6 days ago

  • Keywords commit added

#8 @adamsilverstein
6 days ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 46158:

Build/Test Tools: fix source map loading in Firefox.

Fix an issue that prevented source maps from loading correctly in Firefox developer tools. Matches a fix introduced in Gutenberg build in PR:17024.

Props pierlo, andraganescu.
Fixes #47870.

#9 @desrosj
6 days ago

  • Milestone changed from Awaiting Review to 5.3
Note: See TracTickets for help on using tickets.