I’m facing an issue using Netlify Functions for my Nuxt 3 SSR site.
The function returns this error from the log, when visiting the deploy-preview:
Nov 6, 01:16:38 PM: 5d6d4c7b ERROR [nuxt] [request error] [unhandled] [500] Cannot find module '@vue/devtools-api'
Nov 6, 01:16:38 PM: 5d6d4c7b ERROR Require stack:
Nov 6, 01:16:38 PM: 5d6d4c7b ERROR - /var/task/server.mjs
Nov 6, 01:16:38 PM: 5d6d4c7b ERROR [nuxt] [request error] [unhandled] [500] _createApp is not a function
Nov 6, 01:16:40 PM: 5d6d4c7b Duration: 618.97 ms Memory Usage: 189 MB Init Duration: 1860.24 ms
Our Sentry logs the error, and elaborates that it happens here:
I’ve checked that vue-router has @vue/devtools-api as dependency. Even added it to our own package.json.
When building locally either using yarn or netlify serve, everything works perfectly.
The issue only appears when pushing to Netlify, and for this I need some help to figure out how to resolve this.
Hi @stockholmz – I was experiencing this same issue. It seems to be caused by nitro version > 2.10. To fix, I installed nitropack@2.9.7 explicitly to my devDependencies and this resolved pnpm install nitropack@2.9.7 --save-dev.
Alternatively, it also seems that explicitly adding vue and vue-router “latest” to package.json dependencies will solve this.
Thanks for the lead! That was really a needed one!
So, I made it work with rolling back to nuxt@3.13.2 which depends on nitropack@^2.9.7
This would still install nitropack@2.10.x, so I had to add this to my package.json
I’m still having this issue. @stockholmz’s solution worked on a site yesterday but on a different build, even though package.json is the same, I’m getting this issue.
This got opened as a bug in Nitro, but closed again as it seems at some point vue-router became required on Nuxt. I added it to my project and it seems to have resolved this issue.