WordPress.org

Make WordPress Core

Opened 3 months ago

Closed 2 months ago

Last modified 2 months 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: 5.3
Component: Build/Test Tools Keywords: has-patch dev-feedback commit
Focuses: javascript Cc:
PR Number:

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 3 months ago.

Download all attachments as: .zip

Change History (10)

@pierlo
3 months ago

#1 @SergeyBiryukov
3 months ago

  • Component changed from General to Build/Test Tools

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


3 months ago

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


2 months ago

#6 @adamsilverstein
2 months ago

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

#7 @adamsilverstein
2 months ago

  • Keywords commit added

#8 @adamsilverstein
2 months 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
2 months ago

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