How to obtain production environment react.lazy Our support
See original GitHub issueIs your feature request related to a problem? Please describe.
react.lazy Itās available during development, like this
const Component = lazy(() => import(`../pages${page}`));
But after build, the import failed
Describe the solution youād like
After build, it can work normally
Describe alternatives youāve considered
Additional context
I just tried to use vite in react to see if I could migrate from CRA š
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
React Lazy Loading: The Best Complete Guide - CopyCat Blog
Learn how to optimize your app with a complete guide to React lazy loading and code splitting with coding examples, tips, videos, and...
Read more >Lazy loading React components - LogRocket Blog
Using React.āā React. lazy() makes it easy to create components that are loaded using dynamic import() but rendered like regular components. ThisĀ ...
Read more >React lazy loading and performance - Retool
The React.lazy() function allows you to render a dynamic import as a normal component. It makes it simple to construct components that areĀ ......
Read more >Setup Development and Production Environment for React App
Step 2: Let's add react and webpack in our project. Run the below command to install react and webpack. npm install react react-dom...
Read more >React.lazy not working in production mode - Stack Overflow
Like I mentioned in the question, the babel-minify-webpack-plugin was causing the issue for some reason. My guess is, they were savingĀ ...
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
@jonaskuske Thank you very much.š
Iāve looked at the restrictions again, and now I understand
Two main points
Since my
page
was a directory, I need to add it now index.tsxAnd
dynamic import vars
has been introducedšOkay, I feel like Iām stupid. Iāll close this issue laterš¤¦āāļø
Awesome, glad I could help! š¤