parcel
parcel copied to clipboard
Can't do nested lazy import in react
π bug report
I cant do something like:
const Documentation = lazy(() => import('./components/Documentation'));
then inside Documentation do:
const Chapter1 = lazy(() => import('./components/Chapter1'));
π€ Expected Behavior
Should work
π― Current Behavior
Errors out.
π Possible Solution
Hacky workaround is to use an import, stops the code splitting from working though.
π¦ Context
I want to use a nested route with a large site.
π» Code Sample
as above
π Your Environment
Software | Version(s) |
---|---|
Parcel | 2.6.2 |
Node | 17.1 |
npm/Yarn | 3.2.1 |
Operating System | Mac |
Please provide a reproduction. And also just saying "Errors out." without the actual error message isn't very helpful
@mischnic do you use an online debugger for cases like this? Iβm happy to replicate on a sandbox tool. Just so trivial to replicate I thought you would manage. But guess you guys must be swamped atm.
I haven't tried it yet, but TBH it's rather often some small (unrelated) detail that triggers a reported bug.
And if you post the error, we can sometimes make educated guesses without even debugging it locally
Always swamped πΆπ