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

fail nuxt preview, because there is no file unde output/public/__i18n__/ #2170

Closed
henkelhiedl-dev-team opened this issue Jun 20, 2023 · 2 comments · Fixed by #2199
Closed
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf v8

Comments

@henkelhiedl-dev-team
Copy link

henkelhiedl-dev-team commented Jun 20, 2023

Environment

  • nuxt: 3.5.2
  • @nuxtjs/i18n: 8.0.0-beta.12

Reproduction

https://github.com/yoshito-maeoka/nuxt-i18n-prerender-problem

Describe the bug

with nuxt dev works.

    ❯ yarn dev                                                                                                        
    yarn run v1.22.18                                                                                                 
    $ nuxt dev                                                                                                        
      > Local:    http://localhost:3000/                                                                              
            :                                                                                                         
            :                                                                                                         
    ✔ Nuxt Devtools is enabled v0.5.5 ℹ Vite client warmed up in 710ms                                                
    ✔ Nitro built in 379 ms                                                                                           
    ✔ Vite server hmr 21 files in 822.595ms                                                                           
                                                                                                                      
  Image: en → https://github.com/yoshito-maeoka/nuxt-i18n-prerender-problem/blob/main/assets/img/en.png               
  Image: ja → https://github.com/yoshito-maeoka/nuxt-i18n-prerender-problem/blob/main/assets/img/ja.png               

but with nuxt preview does not work.

  ❯ yarn preview                                                                                                    
  yarn run v1.22.18                                                                                                 
  $ nuxt preview                                                                                                    
  Nuxi 3.5.3                                                                                                        
              :
              :                                                                                                                      
  Listening http://[::]:3000                                                                                        
  @nuxtjs/i18n Cannot find module '/Users/an-user/work/nuxt-i18n-prerender-                                         
problem/.output/public/__i18n__/prerender/e525609c.js' imported from /Users/an-user/work/nuxt-i18n-prerender-       
problem/.output/server/chunks/app/_nuxt/i18n.options-810bdec2.mjs                                                   
  [nuxt] [request error] [unhandled] [500] Cannot read properties of null (reading 'e525609c')                      
    at ./server/chunks/nitro/node-server.mjs:813:26                                                                 
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)                                   
    at async Object.handler (./server/node_modules/h3/dist/index.mjs:1255:19)                                       
    at async Server.toNodeHandle (./server/node_modules/h3/dist/index.mjs:1330:7)                                   
                                                                                                                    
Image: ng → https://github.com/yoshito-maeoka/nuxt-i18n-prerender-problem/blob/main/assets/img/ng.png               

under .output/public does not exist i18n directory

❯ ls .output/public 
_nuxt		favicon.ico

Additional context

No response

Logs

No response

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

May be related to how the config is prerendered into an ESM. See related:

nuxt/nuxt#21051

This is currently a problem for me in production. I would greatly appreciate a fix

@kaboume
Copy link

kaboume commented Jun 22, 2023

same issue.
Translate works on local mode (npm run dev) but after deploy, no translation and the same error message in logs

Cannot find module '/var/www/XXX/.output/public/__i18n__/prerender/a30fcf66.js' imported from /var/www/XXX/.output/server/chunks/app/_nuxt/i18n.options-1fb8b9a5.mjs

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

Successfully merging a pull request may close this issue.

4 participants