#35371: False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
-------------------------------------+------------------------------------
Reporter: Michael | Owner: nobody
Type: Bug | Status: new
Component: contrib.staticfiles | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+------------------------------------
Changes (by Sarah Boyce):
* stage: Unreviewed => Accepted
* summary: JS module export regex does not handle certain minified code
correctly =>
False positive in JS module aggregation export regex when an export
declaration precedes an import declaration
* type: Uncategorized => Bug
* version: 5.0 => dev
Comment:
Thank you for the report! Replicated on main.
This can occur also when the JS is not minified.
For anyone wanting to pick this up. If we make the following update:
{{{
diff --git a/tests/staticfiles_tests/project/documents/cached/module.js
b/tests/staticfiles_tests/project/documents/cached/module.js
index 7764e740d6..e9e61df56c 100644
--- a/tests/staticfiles_tests/project/documents/cached/module.js
+++ b/tests/staticfiles_tests/project/documents/cached/module.js
@@ -1,3 +1,4 @@
+export const moduleConst = "module";
// Static imports.
import rootConst from "/static/absolute_root.js";
import testConst from "./module_test.js";
}}}
then tests for
`staticfiles_tests.test_storage.TestCollectionJSModuleImportAggregationManifestStorage`
fail with the reported error.
--
Ticket URL: <https://code.djangoproject.com/ticket/35371#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018edd13a984-c8e6d548-c6fe-49f5-b812-099fb02b3709-000000%40eu-central-1.amazonses.com.