question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`next export` does not work

See original GitHub issue

Describe the bug When doing a next export to built a static page, i get the following error:

TypeError: Cannot read property '0' of undefined
    at /Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/next-i18next/dist/hocs/app-with-translation.js:155:68
    at Array.filter (<anonymous>)
    at _callee$ (/Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/next-i18next/dist/hocs/app-with-translation.js:154:61)
    at tryCatch (/Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/regenerator-runtime/runtime.js:288:22)
    at Generator.prototype.(anonymous function) [as next] (/Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/regenerator-runtime/runtime.js:114:21)
    at asyncGeneratorStep (/Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
    at _next (/Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
    at /Users/tillhinrichs/Documents/_DEVELOPER/HTML/CleanCleanShop/cc-next2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:32:7
    at new Promise (<anonymous>)

To Reproduce Steps to reproduce the behavior:

  1. Clone or download this repository
  2. In terminal do cd example
  3. Install dependencies: yarn
  4. I had to install next-i18next as well: yarn add next-i18next
  5. Check if it runs in dev: yarn run dev -> Works
  6. Check if it builds: yarn run next build -> Works
  7. Check if it exports: yarn run next export -> Fails

Expected behaviour A static version of the app/page should be built.

OS (please complete the following information):

  • Device: MacBook Pro (15-inch, 2017)
  • Browser: Chrome Version 70.0.3538.110

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

28reactions
isaachinmancommented, Nov 30, 2018

This is fixed with #15.

Now, doing next export in a next-i18next project will result in a clientside-only React application.

No future plans to support any kind of custom export process with locale subdirs.

7reactions
elbothocommented, Jun 4, 2019

If someone full export: Those two issues contain some hints: https://github.com/zeit/next.js/issues/2665 https://github.com/zeit/next.js/issues/5509

Read more comments on GitHub >

github_iconTop Results From Across the Web

`next export` does not work · Issue #10 - GitHub
When doing a next export to built a static page, i get the following error: TypeError: Cannot read property '0' of undefined at ......
Read more >
How to fix failing NextJS export - working fine locally but upon ...
First, you can't console.log after return. Second. Use isomorphic-fetch and this construction, i think that in your case help this:
Read more >
Advanced Features: Static HTML Export - Next.js
Export your Next.js app to static HTML, and run it standalone without the need of a Node.js server.
Read more >
Understanding static HTML export in Next.js - LogRocket Blog
Learn why you should use HTML static exporting from a Next.js application, HTML static export use cases, and how you can do it...
Read more >
Export a JSS Next.js app to static HTML files with next export
Make the JSS Next.js app compatible with static file export and ... Static HTML export does not support: ... Run jss deploy config...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found