﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
34322	ManifestStaticFilesStorage crashes on commented JavaScript import statements	Adam Johnson	Mariusz Felisiak	"#32319 added module support to `ManifestStaticFilesStorage`. It can crash with imports in comments, which are used for Typescript ([https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types docs]) but don't necessarily resolve when code is bundled.

Example [https://github.com/bigskysoftware/htmx/blob/master/src/htmx.js from htmx]:

{{{
//** @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.

This may be a challenge as comments can be multi-line like:

{{{
        /**
         * @param {HTMLElement} elt
         * @returns {import(""./htmx"").HtmxTriggerSpecification[]}
         */
}}}"	Bug	closed	contrib.staticfiles	4.2	Release blocker	fixed			Accepted	1	0	0	0	0	0
