Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#44560 closed defect (bug) (fixed)

Console warning because `build/.../underscore.min.js` references `sourceMapURL` that doesn't exist

Reported by: iandunn's profile iandunn Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.1 Priority: low
Severity: minor Version: 5.1
Component: Build/Test Tools Keywords: good-first-bug has-patch needs-refresh
Focuses: javascript Cc:

Description

r43138 introduced a regression where build/wp-include/js/underscore.min.js has an invalid sourceMapURL value:

//# sourceMappingURL=underscore-min.map

This results in a warning in the browser console:

Source map error: request failed with status 404
Resource URL: http://wp-develop.test/wp-includes/js/underscore.min.js?ver=1.8.3

Attachments (13)

44560.diff (867 bytes) - added by laghee 6 years ago.
44560.2.diff (4.0 KB) - added by 5hel2l2y 5 years ago.
44560.3.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.4.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.5.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.6.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.7.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.8.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.9.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.10.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.11.diff (833 bytes) - added by 5hel2l2y 5 years ago.
44560.12.diff (0 bytes) - added by 5hel2l2y 5 years ago.
44560.13.diff (0 bytes) - added by 5hel2l2y 5 years ago.

Download all attachments as: .zip

Change History (20)

#2 @arcturusink
6 years ago

I was able to replicate the warning.

However, I can't find the underscore.min.js file anywhere inside the src directory, so confused as to how to proceed with the issue.

Last edited 6 years ago by arcturusink (previous) (diff)

@laghee
6 years ago

#3 @laghee
6 years ago

  • Keywords has-patch added; needs-patch removed

I was able to reproduce the console warning, and I'm attaching a patch that should fix this.

I needed to add both underscore-min.map and underscore.js to the section of the Gruntfile that copies over npm-package files. Adding only the map file didn't eliminate the error (because the map lists underscore.js with the "sources" key).

If there's a better approach or change needed, I'm happy to comply. Thx!

Last edited 6 years ago by laghee (previous) (diff)

This ticket was mentioned in Slack in #core by sergey. View the logs.


6 years ago

#5 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 5.1
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#6 @netweb
6 years ago

  • Keywords needs-refresh added

Patch 44560.diff needs a refresh following [44529]

#7 @pento
6 years ago

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

In 44632:

Build Tools: Uglify underscore.min.js while building.

This avoids a sourceMappingURL being in the minified file, as we don't ship source maps.

Props pento, laghee.
Fixes #44560.

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

@5hel2l2y
5 years ago

Note: See TracTickets for help on using tickets.