5.1.x Regression - dynamic named import in dev mode not working as expected #16106
Closed
7 tasks done
Labels
p3-minor-bug
An edge case that only affects very specific usage (priority)
regression
The issue only appears after a new release
Describe the bug
I am importing the library
xss
using a dynamic, named import, like this:I expect this to import the
FilterXSS
value from thexss
library and call it as a constructor.FilterXSS
is undefined.Also worth noting:
import xss from "xss";
works fine in all situations.import { FilterXSS } from "xss";
works fine in all situations.(await import("xss")).default
also works fine in all situation.Reproduction
https://github.com/n3dst4/vite-xss-import-bug-repro
Steps to reproduce
Clone the repo https://github.com/n3dst4/vite-xss-import-bug-repro
Install deps
To run in dev mode (to see the broken behavior):
To run in production mode (wherein the bug does not manifest):
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: