vuejs / vue-cli

🛠️ webpack-based tooling for Vue.js Development
https://cli.vuejs.org/
MIT License
29.77k stars 6.33k forks source link

Error when building with taget lib : The "from" argument must be of type string. Received undefined #7291

Open wal0x opened 1 year ago

wal0x commented 1 year ago

Version

4.5.19

Environment info

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE    
    Yarn: Not Found
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD        
  Browsers:
    Chrome: 105.0.5195.54
    Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.27)
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.4.0
    @vue/babel-helper-vue-transform-on:  1.0.2
    @vue/babel-plugin-jsx:  1.1.1
    @vue/babel-plugin-transform-vue-jsx:  1.4.0
    @vue/babel-preset-app:  4.5.19
    @vue/babel-preset-jsx:  1.4.0
    @vue/babel-sugar-composition-api-inject-h:  1.4.0
    @vue/babel-sugar-composition-api-render-instance:  1.4.0
    @vue/babel-sugar-functional-vue:  1.4.0
    @vue/babel-sugar-inject-h:  1.4.0
    @vue/babel-sugar-v-model:  1.4.0
    @vue/babel-sugar-v-on:  1.4.0
    @vue/cli-overlay:  4.5.19
    @vue/cli-plugin-babel: ~4.5.19 => 4.5.19
    @vue/cli-plugin-router:  4.5.19
    @vue/cli-plugin-vuex:  4.5.19
    @vue/cli-service: ~4.5.19 => 4.5.19
    @vue/cli-shared-utils:  4.5.19
    @vue/compiler-sfc:  2.7.10
    @vue/component-compiler-utils:  3.3.0
    @vue/preload-webpack-plugin:  1.1.2
    @vue/web-component-wrapper:  1.3.0
    vue: ^2.6.11 => 2.7.10
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.10.0 (16.8.3)
    vue-style-loader:  4.1.3
    vue-template-compiler: ^2.6.11 => 2.7.10
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

Then :

What is expected?

Building project as a library

What is actually happening?

Error :

Syntax Error: Thread Loader (Worker 6) The "from" argument must be of type string. Received undefined


This issue happens only with Vue 2.7.X and on a FRESHLY installed node modules. If we rerun build library again after failure it passes successfully. I suspect that the issue is linked to Babel somehow, because when I tried to generate the same project but without choosing Babel I had no issues.

yuguaa commented 1 year ago

same error,lock vue and vue-template-complier version

wal0x commented 1 year ago

same error,lock vue and vue-template-complier version

What do you mean by "lock vue and vue-template-complier version"

yuguaa commented 1 year ago

same error,lock vue and vue-template-complier version

What do you mean by "lock vue and vue-template-complier version"

image

wal0x commented 1 year ago

I needed Vue 2.7 so I tried to lock them both to 2.7.0 and 2.7.10, still getting the error

150148313 commented 1 year ago

parallel set false

wal0x commented 1 year ago

@150148313 well, I don't know exactly how or why but it worked. It's a nice shortcut to have for now while waiting for a fix maybe.

gregveres commented 9 months ago

@150148313, @wal0x What does "parallel set false" mean? I am running into this occasionally and it is very frustrating.

coffeebiscuit commented 1 month ago

@150148313, @wal0x What does "parallel set false" mean? I am running into this occasionally and it is very frustrating.

Sometimes worker-loader conflicts with thread-loader, causing the problem.

module.exports = {
    ...
    parallel: false, // Do Not use thread-loader
    ...
}

in vue.config.js would work.