-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Thread-loader with non-serializable types #5723
Comments
RobbinBaauw
changed the title
Thread-loader with references
Thread-loader with non-serializable types
Jul 29, 2020
haoqunjiang
added a commit
to vuejs/vue-loader
that referenced
this issue
Aug 10, 2020
So that all the options are serializable and can be used with thread-loader. Fixes #1705 Fixes vuejs/vue-cli#5723
Fixed in vue-loader v16.0.0-beta.5 |
This doesn't fix the issues for other loaders. I think a warning in the docs at the |
Makes sense. PR's welcome. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
4.5.0
Reproduction link
https://github.com/RobbinBaauw/vue-cli-thread-repro
Environment info
Steps to reproduce
Note that I made 2 changes w.r.t. a generated project (RobbinBaauw/vue-cli-thread-repro@7295f13):
main.ts
vue.config.js
and changedts-loader
with anerrorFormatter
. Setparallel
totrue
.Now build. You'll get an error:
If you change
parallel
tofalse
, it'll give the custom typescript error. This is expected behavior.What is expected?
Both parallel and non-parallel give this typescript custom error
What is actually happening?
If
thread-loader
is used (so for compiling Typescript or by using Babel), the config is passed to the threads in buffers (strings). If you use non-serializable objects in yourvue.config.js
(such as functions), these objects are removed when serializing to this string, and thus you get these "undefined" errors when usingthread-loader
(see webpack-contrib/thread-loader#89 (comment)).I ran into this "bug" when providing a custom renderer in Vue. This repro however shows that any reference type (such as functions) doesn't work. I don't know how to solve this properly, but at least providing a clear heads up in the docs (for example on https://cli.vuejs.org/guide/webpack.html) would be nice.
The text was updated successfully, but these errors were encountered: