Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#47870 closed defect (bug) (fixed)

Unable to load source maps from webpack in Firefox

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

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 7 years ago.

Download all attachments as: .zip

Change History (10)

@pierlo
7 years ago

#1 @SergeyBiryukov
7 years ago

  • Component GeneralBuild/Test Tools

#2 follow-up: @andraganescu
7 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
7 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.


7 years ago

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


7 years ago

#6 @adamsilverstein
7 years ago

  • Owner set to adamsilverstein
  • Status newassigned

#7 @adamsilverstein
7 years ago

  • Keywords commit added

#8 @adamsilverstein
7 years ago

  • Resolutionfixed
  • Status assignedclosed

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
7 years ago

  • Milestone Awaiting Review5.3
Note: See TracTickets for help on using tickets.