Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#47870 closed defect (bug) (fixed)

Unable to load source maps from webpack in Firefox

Reported by: pierlo's profile pierlo Owned by: adamsilverstein's profile adamsilverstein
Milestone: 5.3 Priority: normal
Severity: normal Version: 5.3
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 5 years ago.

Download all attachments as: .zip

Change History (10)

@pierlo
5 years ago

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Build/Test Tools

#2 follow-up: @andraganescu
5 years 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 years 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 years ago

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


5 years ago

#6 @adamsilverstein
5 years ago

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

#7 @adamsilverstein
5 years ago

  • Keywords commit added

#8 @adamsilverstein
5 years 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
5 years ago

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