-
Notifications
You must be signed in to change notification settings - Fork 414
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
Error on build using webpack and linaria v5: module is disposed #1352
Comments
I have faced this problem before and was sure that @Anber managed to fix it. To debug it we will need a minimum reproducible example or at least a full debug log (excluding sources). Can you run build with debug and attach the log? I.e. DEBUG=linaria:*,-*:source* pnpm build 1>log.txt 2>&1 |
Well, as I said, we will face the consequences of using WeakRef. Here we are :) |
i have same error |
It's not the same error, please create a separate issue and provide a minimal reproduction case. |
|
Solution from @Anber above helped me. It was a stray and forgotten |
I'm also seeing this in vite (production builds), not sure if it's related. Not able to provide an example since the code isn't public and the codebase is pretty big, but it seems to happen when there's lazy import calls (thus splitting up the bundle), i.e. lazy loading JSX components. I'll post a repro if I somehow manage to reproduce it, but small codebases don't really seem to trigger it. |
@Anber Is |
Hi @brijeshb42 Yep, it significantly reduces memory consumption in some cases. A better and smarter cache invalidation strategy would help there, but for now, I can suggest an option in config for enabling/disabling WeakRef usage so we will not need to maintain forks. Would that be okay with you? |
Yeah. That'd work atleast till we get any issue reported around this. I would be happy to contribute this change. We are planning on migrating |
I would be happy to accept a PR with this change :) Also, it would be cool if you could contribute your changes in loaders. It's hard to maintain all possible plugins, but together, we can handle it. |
Environment
Description
We were successfully using
3.0.0-beta.15
before, and have quite a lot of style-related code, complicated import chains, etc. Several attempts at v4 migration failed, as code executor was producing a lot of runtime errors at build time.Now I'm trying out v5, and initial build looks quite promising. The only error I'm getting (repeated several times) is about a module being disposed:
Truncated, full log here.
The exact stack of components is different on every build. But the error is the same, and it always revolves around some of these files (like
unit-definitions.ts
above), that acts like a dictionary and contains lots of (static) imports.There may be some import loops here. Is v5 immune against them?
Reproducible Demo
I will need some time to make a minimal reproducible example. Just wanted to deliver an early feedback on v5.
Thanks
Anyway, I'm really impressed on all the fresh development you are doing on linaria! I'm grateful for all contributors here!
The text was updated successfully, but these errors were encountered: