Skip to content
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

[NUXT3] Deploy to Vercel, Failed: [nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/vercel/path0/.nuxt/i18n/config-cfcb45fa.js' #2016

Closed
TangsWang opened this issue Apr 20, 2023 · 8 comments · Fixed by #2025 or #2199
Assignees
Labels
config need reproduction 💻 ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf v8

Comments

@TangsWang
Copy link

TangsWang commented Apr 20, 2023

Environment

"devDependencies": {
"@nuxtjs/i18n": "^8.0.0-beta.11",
"nuxt": "3.3.3"
},

Reproduction

"devDependencies": {
"@nuxtjs/i18n": "^8.0.0-beta.11",
"nuxt": "3.3.3"
},

nuxt.config.ts
modules: ['@vueuse/nuxt', '@unocss/nuxt', '@nuxt/content', '@nuxtjs/i18n'],
i18n: {
vueI18n: './i18n.config.ts',
},

i18n.config.ts:
export default defineI18nConfig(nuxt => ({
legacy: false,
locale: 'en',
messages: {
...
}}))

vercel

Describe the bug

[nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/vercel/path0/.nuxt/i18n/config-cfcb45fa.js'

Additional context

No response

Logs

No response

@dhondtlaurens
Copy link

I have the same error when deploying on AWS Lambda:

[nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/Users/laurensdhondt/Sites/xxx/xxx/.nuxt/i18n/config-0b4859c1.js'

Note how it refers to a path on my local machine.

@hansemannn
Copy link
Contributor

hansemannn commented Apr 23, 2023

Same here - deployments on Vercel (and likely other providers) fail right now:

[nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/vercel/path0/.nuxt/i18n/config-cfcb45fa.js'

and

[nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/vercel/path0/.nuxt/i18n/config-cfcb45fa.js'

[nuxt] [request error] [unhandled] [500]  (500  (/__i18n__/precompile))
  at async precompileMessages (./chunks/app/server.mjs:3122:29)  
  at async i18n_options (./chunks/app/_nuxt/i18n.options-9b43ac01.mjs:33:23)  
  at async vueI18nConfigLoader (./chunks/app/server.mjs:2765:81)  
  at async resolveNuxtI18nOptions (./chunks/app/server.mjs:2767:19)  
  at async Object.setup (./chunks/app/server.mjs:3397:116)  
  at async Object.callAsync (./node_modules/unctx/dist/index.mjs:72:16)  
  at async applyPlugin (./chunks/app/server.mjs:135:33)  
  at async applyPlugins (./chunks/app/server.mjs:144:5)  
  at async createNuxtAppServer (./chunks/app/server.mjs:4377:7)  
  at async Object.renderToString (./node_modules/vue-bundle-renderer/dist/runtime.mjs:176:19)
[nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/vercel/path0/.nuxt/i18n/config-cfcb45fa.js'

@kazupon kazupon added v8 ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf config and removed pending triage labels Apr 24, 2023 — with Volta.net
@kovai
Copy link

kovai commented Apr 26, 2023

I had the same problem.
The secret is very simple. It was the file system permissions to write files to .nuxt directory, because the file .nuxt/i18n/config-cfcb45fa.js was created after running node .output/server/index.mjs.
And simply fixed by adding file write permissions to the .nuxt directory for the node process.

@TuguldurJ
Copy link

I had the same problem.
The secret is very simple. It was the file system permissions to write files to .nuxt directory, because the file .nuxt/i18n/config-cfcb45fa.js was created after running node .output/server/index.mjs.
And simply fixed by adding file write permissions to the .nuxt directory for the node process.

You mean every time you build, change permission per files manually on a server? If you are using vercel like cd/ci deployment, it cannot be possible. What is the root issue?

@kazupon kazupon self-assigned this May 8, 2023
@kazupon kazupon reopened this May 8, 2023
Copy link
Collaborator

kazupon commented May 8, 2023

I've fixed this issue.
Please check edge channel 8.0.0-beta.11-28059008.d1499b6 version.
Thanks!

@erunks
Copy link

erunks commented May 9, 2023

I've fixed this issue. Please check edge channel 8.0.0-beta.11-28059008.d1499b6 version. Thanks!

I updated to this most recent commit, but am still experiencing this issue with Netlify's build process. This is the error message I see in the Netlify function logs:

ERROR [nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, open '/opt/build/repo/.nuxt/i18n/config-9bec0e7d.js'

Copy link
Collaborator

kazupon commented May 10, 2023

I've tried to deploy the following repository with vercel and netlify.
I could not reproduce this issue.
https://github.com/kazupon/nuxt-i18n-hosting-repro-1

vercel: https://nuxt-i18n-repro-1.vercel.app/
netlify: https://harmonious-treacle-7e0aaa.netlify.app/

Could you give us your minimal repo please? 🙏

@JasonLandbridge
Copy link

@kazupon I think this is related with a reproducible repo #2089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config need reproduction 💻 ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf v8
Projects
None yet
8 participants