nuxt / vercel-builder

Vercel Builder for Nuxt
MIT License
645 stars 76 forks source link

nuxt generate error with nuxt-i18n #351

Closed girardinsamuel closed 4 years ago

girardinsamuel commented 4 years ago

Hi !

I am testing a Nuxt static generated app on Vercel (sounds very promising 💪)

After dependencies installation, when vercel run npm run generate I get the following error :

17:15:43.695 | > my_repo@1.0.0 generate /vercel/61f2f93f
-- | --
17:15:43.695 | > nuxt generate
17:15:44.407 | FATAL  Error parsing /vercel/61f2f93f/node_modules/vue-i18n-extensions/package.json: Unexpected token , in JSON at position 3089
17:15:44.407 | SyntaxError: Error parsing node_modules/vue-i18n-extensions/package.json: Unexpected token , in JSON at position 3089
17:15:44.407 | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
17:15:44.418 | ╭──────────────────────────────────────────────────────────────────────────────────────╮
17:15:44.418 | │                                                                                      │
17:15:44.418 | │   ✖ Nuxt Fatal Error                                                                 │
17:15:44.418 | │                                                                                      │
17:15:44.418 | │   SyntaxError: Error parsing                                                         │
17:15:44.418 | │   /vercel/61f2f93f/node_modules/vue-i18n-extensions/package.json: Unexpected token   │
17:15:44.418 | │   , in JSON at position 3089                                                         │
17:15:44.418 | │                                                                                      │
17:15:44.418 | ╰──────────────────────────────────────────────────────────────────────────────────────╯
17:15:44.432 | npm ERR! code ELIFECYCLE
17:15:44.432 | npm ERR! errno 1
17:15:44.433 | npm ERR! my_repo@1.0.0 generate: `nuxt generate`
17:15:44.433 | npm ERR! Exit status 1
17:15:44.433 | npm ERR!
17:15:44.433 | npm ERR! Failed at the my_repo@1.0.0 generate script.
17:15:44.433 | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
17:15:44.440 | npm ERR! A complete log of this run can be found in:
17:15:44.440 | npm ERR!     /vercel/.npm/_logs/2020-09-04T15_15_44_434Z-debug.log
17:15:44.445 | Error: Command "npm run generate" exited with 1
17:15:47.471 | Done with "package.json"

I am using nuxt-i18n and vue-i18n-extensions is a dependency. Here are an overview of my app dependencies :

"dependencies": {
  3     "@nuxtjs/axios": "^5.12.2",
  4     "@nuxtjs/google-tag-manager": "^2.3.2",
  5     "@nuxtjs/sitemap": "^1.2.0",
 18     "nuxt": "^2.14.4",
 19     "nuxt-i18n": "^4.1.0",
 41   },

It's working in local and in other environments. Do you have some clues about this issue ? Thanks 👍 !

danielroe commented 4 years ago

Initially I should say that you don't need this builder if you are generating a static site on Vercel.

But if you do want a serverless function instead - could you prepare a small reproduction repo so I could investigate?

girardinsamuel commented 4 years ago

Thanks for your quick answer !

I guess I did not understand what this repo was about. I was thinking it was the tool that Vercel uses to deploy Nuxt apps. I must have forgotten the serverless part. So I don't need this builder that's right and I don't use one (I've just configured a deployment from Vercel dashboard).

Where should I post this issue then ?

danielroe commented 4 years ago

@girardinsamuel I would consider directly on the vue-i18n-extensions package repo, as they may have better information, and via Vercel's support channel.

Just from the error message, it looks like it might be a Unicode issue so you could also try specifying Node 12.x in your package.json engines, in case this is a problem specific to an older version of Node.