-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Full Dynamic Import failing @5.14.0 #649
Comments
Hey @Marlrus 👋, |
Sounds like #630 |
Hi theKaskey thanks for the quick reply. I looked at the thread for #630 and #629. I also reproduced the conditions for the unexpected functionality to go deeper into the details. I get no errors in the terminal at all, the component just doesn't render. I get to the page where the component gets rendered dynamically and it is just a blank. If I revert to something before 5.14.0 the component displays once more. Is there any way I can test for what you mean in #630 to see if my component is static and if I'm deriving a cache key? Help would be greatly appreciated and I would love to dig and learn where the issue might be. Cheers! |
No error and no component? Can you inspect it in dev tools? Is it SSR or purely client side stuff? |
Indeed, no error and no component. Currently I am getting the default fallback component which is a Map Component wherever the other components should be. It is in a CSR app using Create React App. Using DevTools I can see in the component tree that there are two instances of InnnerLoadable The top one has the prop innerComponent with the path to the component This instance is the one that is failing to import using the props.component value. Every component that renders this way is defaulting the the Map component which is on a totally different path. |
Ok. Much better!
|
I think I solved this problem (had it too). The reason is not using loadable babel plugin AND not specifying manual cache key for pages as written in docs. It worked in Technically there is a regression in |
@KACAH - so you were writing "unrolled imports" manually, and accidentally breaking contracts? Was not considering this option as an option. Can you share your reasons not to use the babel plugin? |
Hmmm. I am not sure, what do you mean by "unrolled imports" and contracts. Can you explain, please? I was using const Page = loadable(props => import(`./${props.component}.screen`), {
fallback: <Loading />,
})
....
for (const route of routes) {
....
<Route path={route.path}>
<Page component={route.component} />
</Route>
} So, basically, I have pages of my application (URLs) separated to different component files (with .screen postfix) and loaded dynamically.
I am trying to avoid any additional dependency as long as it is reasonably possible. Especially when it comes to "build" dependencies. More dependencies -> More code -> Less stable the whole system is. Plus, I realy cringe to see things like this this in my yarn.lock file
Do I really need four libraries to make string camel case... |
Ok. Got you. Look like that commit broke non-babelified integrations, and is not required for babelified ones (with I'll double check, but probably the easiest way is to:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
💥 Regression Report
After the update to 5.14.0 components were not loading with the previous syntax:
This makes our component update to the latest version that is a minor release: backward compatible new features.
Last working version
Worked up to version: 5.13.x
Stopped working in version: 5.14.0
To Reproduce
Steps to reproduce the behavior:
Pattern used: Full Dynamic Import
npm install @loadable/component
Expected behavior
This is the structure we were handling:
The expected behavior was that the component gets loaded after passing the path.
Run
npx envinfo --system --binaries --npmPackages @loadable/component,@loadable/server,@loadable/webpack-plugin,@loadable/babel-plugin --markdown --clipboard
Script results:
Note: These are the setting on my local machine, the settings on the production server were different and, unfortunately, I don't have permissions to get the logs directly, and the package was already reverted which resulted in the expected functionality.
We reverted to 5.12.x and things worked
The text was updated successfully, but these errors were encountered: