with-ant-design example not working with SSG on production
See original GitHub issueBug report
Describe the bug
Currently, the with-ant-design example just works with SSG on development.
In production it throw SyntaxError: Cannot use import statement outside a module
for antd components.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Go to this repo and clone the code. This is just a forked of the with-ant-design example with an only addition of a
getStaticProps
function. npm install
oryarn
to install dependencies.npm run build
oryarn build
to build the project.npm start
oryarn start
to run the production build.- See error.
Expected behavior
The with-ant-design example should also work in production.
Screenshots
System information
- OS: macOs
- Browser: Chrome
- Version of Next.js: 9.3.4
- Version of Node.js: 12.13.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Next JS: SSG not working in when passed as prop for a ...
I think that the fetched data is not being properly passed as a props to the child component when building out the production...
Read more >Next.js No longer use SSR/SSG functions - YouTube
Next.js 13 brought a complete redesign to the Data fetching system. No more getServerSideProps or getStaticSideProps and no more separation ...
Read more >Nextjs examples - Seba Online
The first 2. nextjs deno, Developing and shipping production-ready ... You can test it and now flickering issues is gone and you can...
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 FreeTop 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
Top GitHub Comments
@itsmetambui For me changing
"libraryDirectory": "es"
to"libraryDirectory": "lib"
inside of.babelrc
did the trickThis issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.