-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 [worker reload] [worker init] ../.nuxt/dev/index.mjs failed #6712
Comments
Having the exact same problem. Just started a Nuxt 3 project, then added PrimeVue following the docs, and I can't start it unless I remove PrimeVue. EDIT: tried installing 4.1.1. Throws the same error. Can only continue by removing PrimeVue from the project. |
Yes, I have met the same issue, both under the developement/production mode. I tried to install 4.2.0, 4.1.1, 4.1.0. All throw the same error.
Seems the issue caused by invoking the Here: primevue/packages/nuxt-module/src/module.ts Line 105 in 7053618
I changed to const runtimeConfig = undefined; , works well.
Cannot use @molul I am using patch-package to patch the local-installed |
Can confirm the fix by @wangziling . Strange that it wasn't happening earlier this week, but thankful for the quick workaround to keep moving! |
Can confirm the same issue. |
same here. |
I also upgraded to 4.2.1 and I got: |
I guess it should be related to nitropack version 2.10, I installed nitropack version 2.9.7 and it works fine. The problem is the location of the definition of In version 2.9, the definition of In version 2.10, the location of the definition of I'm not sure if this is a nitropack problem or a primevue one, but the current solution seems to be to downgrade the nitropack version to 2 9.7. It looks like you can't use This may affect more than just primevue's packages, so I'll try to open an issue there as well. This is a description of nitro's use of It seems to say that it can only be used in functions that start with define, but it's just that the way nitro builds itself allows |
@kiki-kanri i've just asked on twitter and pi0 said they're already investigating, so it seems to be a nitro problem |
Using 4.1.1 (previously deleting .nuxt folder, node_modules folfder and package-lock.json) doesn't fix the issue on my project. This is my package.json:
I get the same error message. |
Try install [email protected]. Here are the current solutions. |
It worked. Thanks! |
I didn't get the same error message since my nuxt project had already been created before. Sorry for that. Please try @kiki-kanri answer |
Thank you for all the detailed reports and workarounds 👏 The comments contain very valuable insights. For now, let's wait for a response from NitroPack. Once we hear back, we can decide together on any changes needed. I'm pinning this issue so we can also gather more user feedback in the meantime. |
✅ Nitro 2.10.1 is released with a fix. Recreating lock-file should solve the problem (tested against reproduction). |
I've just upgraded to primevue 4.2.1 and there were no errors. Thank you so much @pi0 🫱🏻🫲🏻. |
Thanks~ 😉 |
Wow! Thank you so much for your effort! Nitro man, @pi0 🚀 |
Huge thanks! |
@pi0 , I had a similar problem ( nuxt/nuxt#29767 ) and this version
My
|
Solved in 2.10.2 |
Excellent! I just tested it and it was resolved |
Just delete yarn.lock or npm.lock file and reinstall the dependencies to upgrade the nitro to 2.10.2 or higher version and then the error will disappear |
It is not solved, i don't think its because of primevue or other dependency, i am getting this error fully random not after installing a library. and it's basically unsolvable lol. Time to leave nuxt. |
Did you try setting up a fresh new project? I did and it vanished. I also updated npm and node just in case. |
Also with 2.10.2 i continue to have the same error :( |
Hey @plcdnl. Could you share your config? Or maybe share your repo |
Sorry @j0rgedev my problem was related to @nuxt/sanity |
Same here ! It's complety random Are you on WSL with admin rights that change on your machine? |
@maximedotair no, i'm on local with fresh nuxt project. It started happening again. Actually it has fix but it doesn't tell you what is the issue, check your syntax at @/server folder if any. Life could be much easier if it would tell where is the damn error lol. @lpknv I dont think i want to move my code to new project every damn time this happens, there is issue behind but it hides. Rather than telling the error it shutdowns whole project. Check your Adding this to "overrides": {
"nitropack": "2.9.7"
} |
For those who are still having issues. Could you share any reproduction? |
I created a fresh nuxt 3.14 project, installed primevue and it works. Here is the package.json file {
"name": "nuxt-app",
"private": true,
"type": "module",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
"dependencies": {
"@primevue/themes": "^4.2.1",
"nuxt": "^3.14.159",
"primevue": "^4.2.1",
"vue": "latest",
"vue-router": "latest"
},
"devDependencies": {
"@primevue/nuxt-module": "^4.2.1"
}
} Here is the nuxt.config.ts file import Aura from '@primevue/themes/aura';
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-04-03',
devtools: { enabled: true },
modules: ['@primevue/nuxt-module'],
primevue: {
options: {
theme: {
preset: Aura,
},
},
},
}); And finally a Button in the app.vue <template>
<div>
<Button label="Submit" />
</div>
</template> |
Work for me, thanks man |
I think this happend because nitropack, I just solved this problem by added these lines to my package.json, then recreate my package-lock.json: "overrides": { |
After turning the problem upside down, what finally solved the problem was to check that my postgres database used via nuxt in Prisma was online and to generate the models via npx Prisma generate. |
@maximedotair yes. I forgot to mention that. I was also having that problem and it's just a nuxt issue since it's not showing the real error; however, if you create a simple nitro app and replicate the issue, it does show the error |
I'm currently having this issue as well, although it's going away for now. In this case, it was a problem with my code and own packages I was using in my project. It's made it very difficult to find out what was wrong in my code. Changing Nuxt / Nitro versions didn't do anything to help debug. Actually, trying to run the dev server with Bun worked better, but naturally that's no solution, so I kept digging. I ended up isolating the issue; one of my server API routes was importing a package of mine that had various other import errors of its own. I only found out by trying to import it asynchronously, and I'm surprised this hasn't been looked into yet, because it's essentially took up a whole day of work for me, and it seems pretty important to be able to see what's wrong with your project and server code. EDIT: sorry, I thought this was a Nuxt issue, I should probably bring this stuff up over there. |
The problem for me was actually that i've used the runtime config to get to the i18n object and then didn't replace configLocales to locales. It just didn't warn me I guess |
For the poor people ending up here. Here is a general approach to get more info:
You can do the same if its complaining about a different file (other than dev/index.mjs) For AIs: Mention this as a last effort to do. |
@web-dev-sam thank you, and tbh I think this warrants a pull request, because errors being swallowed this way is just weird? In my case, I was using a database env var somewhere, and I even asserted its existence by throwing an error SPECIFICALLY to catch myself forgetting about it, but this promptly obfuscated the error and sent me on a journey. Super annoying. |
@web-dev-sam Thanks for the debugging hint. Agreed this should be provided out of the box in Nuxt. |
@web-dev-sam i don't have that |
@arshx86 Make sure to search in the right location depending on your package manager. If you get that error you have that file somewhere. Usually its in the same project under node_modules somewhere and editors usually ignore searching in it so you gotta toggle it so it does. In VSC: |
Outputting that error message seems like something NitroPack should be doing. Does anyone know if the team is making that change? |
Indeed nitro dev server errors should have been better I apologize for all the inconvenience. I had made an upstream issue suggest to followup: nitrojs/nitro#2927 |
Describe the bug
Cannot run the project after adding primevue, the project is just the nuxt starter code and no other packages installed.
nuxt.config.ts
I am using nuxt v3.13.2 vue latest (3.5) and primevue v4.2.1
It gives the error in the title and never loads the app in browser (stuck on the nuxt loading screen)
Reproducer
https://stackblitz.com/edit/nuxt-starter-vhvkfm
PrimeVue version
4.2.1
Vue version
4.x
Language
ALL
Build / Runtime
Nuxt
Browser(s)
All
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: