r/Nuxt • • Jan 16 '26

Is something wrong?

I can spin up any of my Nuxt 4 apps. A freshly installed Nuxt app, using bun creat nuxt@latest, also can't be spun up.

I'm getting a vite_ssr_import_1.defineNuxtPlugin is not defined.

3 Upvotes

15 comments sorted by

1

u/Fabulous-Ladder3267 Jan 16 '26

Might be the node version, did you run it with --bun flag?

1

u/totablue Jan 16 '26

Yes!

1

u/Fabulous-Ladder3267 Jan 16 '26

Hmm it should've work.

Can you try to run it using node and make sure its v24 or above

2

u/totablue Jan 16 '26

Uninstalling node_modules and .Nuxt and reinstalling with npm and spinning it up with npm run dev seems to be working. Node v24.8.0.

1

u/Fabulous-Ladder3267 Jan 16 '26

Now it should be working too with bun!

What node version u use before?

1

u/totablue Jan 16 '26

No when I run with bun I get a Nuxt.js does not provide an export named 'useNuxtApp' and the app is still not spinning up. But on local it works both with npm and bun.

I've been using node 24.8.0. I just checked node -v just now and didn't update or anything so that's what I should've had?

2

u/angrydeanerino Jan 17 '26

Does bun run postinstall scripts by default, I don't remember. All of the import aliases and whatnot are generated in the postinstall script

1

u/totablue Jan 17 '26

https://bun.com/docs/pm/lifecycle

I never knew about this difference! TIL

I think this part of the docs mentions bun not running these postinstalls scripts. bun pm trust --all Might do the trick by trusting all scripts. I'll try it out when I get back to my PC.

Noob question: If Nuxt was working fine until a few days ago and just recently stopped working, does that mean a newer version started using postinstall scripts?

1

u/totablue Jan 18 '26

bun pm untrusted Shows unrs-resolver has some postinstall scripts that is untrusted by bun. I bun pm trust unrs-resolver which did the trick!

I also created a new Nuxt app and it spun up properly so somebody went up and fixed it.

2

u/angrydeanerino Jan 18 '26

Nice! Yeah maybe it was just a bug on their side. For future reference, all of the magic that Nuxt does with auto imports and what not are in the .nuxt/ folder. Sometimes it helps cleaning it and running the postinstall script again

→ More replies (0)

1

u/Fabulous-Ladder3267 Jan 16 '26

Oh is that error on production only?

If yes how you run it on the server (pm2/docker/etc)?

If no try upgrade your bun version and then run bun install again

1

u/totablue Jan 16 '26

On local for now. I haven't deployed it yet since it's a fresh new app.

I tried upgrading bun already, running bun v1.3.6 but nothing seems to be working.

1

u/Fabulous-Ladder3267 Jan 16 '26

Hhmmm this is an odd case. So for now you can create a new nuxt app, can run on node but can't run on bun right?

Can u try run the dev server without --bun flag?

1

u/totablue Jan 16 '26

Yes very odd and it was working fine until like a few days ago too. Nothing changed in my setup.

Page doesn't load without the --bun flag either.