-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"module is not defined" in cssesc #1453
Comments
Original issue here: withastro/astro#11395 |
I got this problem too, only appears when loading for the first time, and will be restored when reloading from #11395 |
I'm also running into this error. I'm currently experimenting with the https://vitejs.dev/config/dep-optimization-options#optimizedeps-include setting, monkey-patching vanilla-extract and/or trying to adjust the Astro config. No luck so far :/ |
Meanwhile, I just copied cssesc.js into "overrides": {
"cssesc": "./overrides/cssesc"
} This fixes it for me. I don't expect I'll need to maintain this fork, seeing the original package is dead (5+ years with no update). |
Thanks for that info! I also did that now, as a workaround it'll be fine for me. If anyone from Google finds this, here's what you'll need to do:
|
@jcayzac How did you patch the file exactly? Actually, the patch I described above doesn't work during |
@LekoArts I just replaced the commonjs export with an esm export. |
Gotcha 👍 I've updated my previous message with the instructions now that work for me both in dev and build. I just changed it to provide a dual CJS/ESM package where the |
cssesc is a dependency of @vanilla-extract/css and in dev mode it throws "ReferenceError: module is not defined". Links to issue: vanilla-extract-css/vanilla-extract#1453
cssesc is a dependency of @vanilla-extract/css and in dev mode it throws "ReferenceError: module is not defined". Links to issue: vanilla-extract-css/vanilla-extract#1453
Describe the bug
cssesc.js is CommonJS and can't be imported as a module.
Reproduction
https://stackblitz.com/edit/stackblitz-starters-1kbjbz
System Info
Used Package Manager
npm
Logs
ReferenceError: module is not defined at eval (cssesc.js:110:1) at instantiateModule (dep-BcXSligG.js:53408:11)
Validations
The text was updated successfully, but these errors were encountered: