-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Fix failed builds when using thread-loader #1207
Fix failed builds when using thread-loader #1207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! Thank you!
Now I must reveal a prejudice of mine... I don't really like class
es. It's not an accident that ts-loader
is pretty much a class
free codebase.
From the looks of it, class InstanceCache
is a class
that is instantiated just the once. I wonder if it would be straightforward to switch over to the revealing module pattern here perhaps?
No worries if you don't have time now, this looks functionally completely correct.
Fair point! Switching to that should be fairly easy, I'll make the change 👌 |
Awesome - you want to include the |
Done! I'll also take a look at the other error that I saw when using |
@johnnyreilly I've unlinked this PR from the original issue (#1206), so that it can be closed after users report that it's fixed, but feel free to close it if you prefer handling it that way. |
Travis is stuck - going to override and merge. |
v8.0.9 should be out in the next 20 mins or so - thanks for the quick turnaround @valerio! https://github.com/TypeStrong/ts-loader/releases/tag/v8.0.9 |
Possible fix for #1206
When using
thread-loader
, theloader._compiler
field isundefined
, this causes a runtime error when trying to use it as a key in a WeakMap.This PR changes the instance cache so that it now uses a dummy "marker" object as reference when the compiler instance is undefined.