`next export` does not work
See original GitHub issueDescribe 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:
- Clone or download this repository
- In terminal do
cd example
- Install dependencies:
yarn
- I had to install next-i18next as well:
yarn add next-i18next
- Check if it runs in dev:
yarn run dev
-> Works - Check if it builds:
yarn run next build
-> Works - 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:
- Created 5 years ago
- Comments:17 (9 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is fixed with #15.
Now, doing
next export
in anext-i18next
project will result in a clientside-only React application.No future plans to support any kind of custom export process with locale subdirs.
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