-
Notifications
You must be signed in to change notification settings - Fork 184
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
ERROR ExperimentalWarning: CommonJS module is loading ES Module #927
Comments
Possible duplicate of #902 - could you try nightly version and see if the issue persists? |
I am also reproducing when using latest |
I am also having this issue. This is what I have in my package.json
node: v22.12.0 |
I guess I should go down this route again: #922 |
Getting the same error with clean nuxt setup
|
I'm also running nuxt inside devcontainer. same issue. :( |
Working on a fix! |
Could you give nightly version a try? Will reopen if issue persists. |
yeah same here. |
Ah, I guess issue will persist if any config file uses ESM syntax. Let me reopen and investigate on priority. Though it should be partly resolved still in nightly if your tailwind configs are CJS (which would be discouraged). |
any updates on these? I can't run nuxt on my project until this fix gets merged. |
Could you try adding |
This did not resolve the issue for me. Still getting a |
Hm, thats a dev server startup issue. Might not 100% be tailwind module issue. Could try the suggestion in this comment to see what exactly is the error? primefaces/primevue#6712 (comment) |
Thank you for linking this! This allowed me to debug :) The issue was in fact that I was on a new device and had not set up the .env with secrets correctly because they are not checked into the repo. Seems like the nitropack error swallowed the actual reason, as per your linked comment. Thank you for taking your time to help me out 👍 |
FWIW I came here because I too had the CommonJS module is loading ES Module error and thought it was the cause of the dev server startup error - upgrading to Node 23 fixed the warning, using |
Apologies for taking a while - I was quite puzzled with the Vite dev server issues in the environment and realised it was mostly due to (Merry Christmas! 🎄) |
Thanks a lot! Bugs during holidays are always annoying, but thanks for working on it. Merry Christmas!!
…-------- Original Message --------
On 25/12/2024 11:34 pm, Inesh Bose wrote:
Apologies for taking a while - I was quite puzzled with the Vite dev server issues in the environment and realised it was mostly due to exposeConfig, so we are now able to have a ESM config. Please try out [nightly version](https://tailwindcss.nuxtjs.org/getting-started/installation#nightly-releases) to confirm if the fix is working, and I'll make a stable release accordingly.
(Merry Christmas! 🎄)
—
Reply to this email directly, [view it on GitHub](#927 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AL5DLCQRF5NVSYQWW5ADUMD2HLXRTAVCNFSM6AAAAABTJGRB4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNRRHE3DMMJQGM).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Had the same error in the terminal and after trying the suggestions above here here is my feedback:
|
Tested with the nightly release and can confirm that the warning no longer appears and everything works as expected. Thanks for getting this sorted during the holidays @ineshbose 🫶 Package versions: "nuxt": "^3.15.0",
"@nuxtjs/tailwindcss": "npm:@nuxtjs/tailwindcss@nightly", |
for me as well |
Hmm, would it be possible to get more context by a reproduction please? |
|
For me adding the meanwhile adding What else I should provide here to support this issue to be solved? |
just want to confirm as its a common mistake at times, you are updating |
node upgrade to v23.5.0 solved the issue. check: node -v |
my package.json: {
"name": "potato",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"lint": "eslint .",
"lint:fix": "eslint . --fix"
},
"dependencies": {
"@mdi/font": "^7.4.47",
"@nuxt/fonts": "^0.10.3",
"@pinia/nuxt": "^0.9.0",
"@vicons/ionicons5": "^0.13.0",
"nuxt": "^3.14.1592",
"nuxt-app": "file:",
"pinia": "^2.3.0",
"vue": "latest",
"vue-router": "latest",
"vuetify-nuxt-module": "^0.18.3",
"vuetify-sonner": "^0.3.20"
},
"devDependencies": {
"@nuxt/eslint": "^0.7.4",
"@nuxtjs/tailwindcss": "^6.12.2",
"@stylistic/eslint-plugin": "^2.12.1",
"@types/tailwindcss": "^3.0.11",
"autoprefixer": "^10.4.20",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"postcss": "^8.4.49",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"unplugin-auto-import": "^0.19.0",
"unplugin-vue-components": "^0.28.0",
"vite-plugin-vuetify": "^2.0.4",
"vuetify": "^3.7.6"
}
} I think I've installed tailwind with I'm still using disableHMR at nuxt.config.ts as a workaround btw tailwindcss: { And to answer your question I'm definetely updating |
Hi @gmdias727, You're meant to point See: #927 (comment) |
Here is ahow to set it up the nightly channel {
"devDependencies": {
- "@nuxtjs/tailwindcss": "^6.10.0"
+ "@nuxtjs/tailwindcss": "npm:@nuxtjs/tailwindcss@nightly"
}
} You can check the documentatioin here Link to resource |
My Experience and Current SolutionI've also encountered this error recently. In my case, the error originates from both the Steps I Tried
Key TakeawaysWhile I'm unsure if this is fundamentally a Node.js issue, trying a different Node.js version seems to be a feasible workaround. I recommend experimenting with compatible versions to see if it resolves the problem for your setup. My Working SolutionHere is my {
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@nuxt/ui": "^2.20.0",
"@nuxtjs/google-fonts": "^3.2.0",
"@nuxtjs/tailwindcss": "^6.12.2",
"axios": "^1.7.7",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-vue-next": "^0.469.0",
"nuxt": "^3.15.0",
"pixi.js": "^8.6.6",
"radix-vue": "^1.9.11",
"tech-stack-icons": "^2.1.0",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@iconify-json/radix-icons": "^1.2.0",
"typescript": "^5.7.2"
}
} I hope this helps others experiencing a similar issue. Let me know if additional context would be useful! |
I'm not using |
I think that wouldn't be encouraged (as vite config should be inlined within nuxt.config). I do want to point out that I would not expect or ask devs to be switching node versions (esp to non-LTS) just to make this go away. A stable release is on its way, but if issues persist, I would believe them to be per-project basis, and I am happy to debug if context/repro would be provided. |
Environment
Reproduction
No response
Describe the bug
Using Node LTS version (
22.12.0
) produces this error/warning:Is there a way @nuxt/tailwindcss could produce an ES module instead (e.g.
.nuxt/tailwind.config.mjs
)?Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: