Skip to content
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

Transform failed in Webpack 5 production mode with vue-loader and babel-loader #114

Closed
sxzz opened this issue Jun 2, 2022 · 3 comments
Closed

Comments

@sxzz
Copy link
Member

sxzz commented Jun 2, 2022

When working with vue-loader and babel-loader, the transforms fail. And only in production mode.
Related issue: vue-macros/vue-macros#23

this._compiler? $unpluginContext is undefined, it seems there is no inject to compiler?
image

Since I am in unfamiliar with webpack plugin development, I guess it might be a problem with the inject here.
image

Here is reproduction: https://github.com/sxzz/unplugin-issue
Please run nr build && nr preview

https://github.com/sxzz/unplugin-issue/blob/3ab41951cb179cd11bef2473a77f3686c4ca4744/vue.config.js#L8
Removes babel-loader and then unplugin works

@sxzz sxzz changed the title Transform failed in Webpack 5 production mode Transform failed in Webpack 5 production mode with vue-loader and babel-loader Jun 2, 2022
@loosheng
Copy link

vue-macros/vue-macros#23 (comment)

@Nick-Hopps
Copy link

Nick-Hopps commented Feb 25, 2023

sxzz/unplugin-vue-macros#23 (comment)

I met this issue too, and for me there is nothing to do with thread-loader, I turned it off and the error still.

After some investigation, found a local file which contains only constant definitions lead to this error, so weird.

@Nick-Hopps
Copy link

It turns out to be worker-loader, replace it with new Worker() upon Webpack5 solve this issue.

@sxzz sxzz closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants