Opened 20 months ago

Last modified 16 months ago

#34322 closed Bug

ManifestStaticFilesStorage crashes — at Initial Version

Reported by: Adam Johnson Owned by: nobody
Component: contrib.staticfiles Version: 4.2
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

#32319 added module support to ManifestStaticFilesStorage. It can crash with imports in comments, which bundlers like Webpack can leave in.

Example:

//** @type {import("./htmx").HtmxApi} */

Leads to:

whitenoise.storage.MissingFileError: The file 'example/dist/htmx' could not be found with <whitenoise.storage.CompressedManifestStaticFilesStorage object at 0x16ff630a0>.

The JS file 'example/dist/app.js' references a file which could not be found:
  example/dist/htmx

Please check the URL references in this JS file, particularly any
relative paths which might be pointing to the wrong location.

The regex should be adjusted to only select imports that are alone on a line, with whitespace.

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top