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

build with development mode set & dest folder fails #1073

Closed
capsur opened this issue Apr 4, 2018 · 2 comments
Closed

build with development mode set & dest folder fails #1073

capsur opened this issue Apr 4, 2018 · 2 comments

Comments

@capsur
Copy link

capsur commented Apr 4, 2018

Version

3.0.0-beta.6

Reproduction link

https://github.com/capsur/cc-setup

Steps to reproduce

yarn build -- --mode=development --dest=test

What is expected?

Project is built in development mode and output goes into test folder

What is actually happening?

vue-cli-service build --mode=development --dest=test

-  Building for development...\node_modules\@vue\cli-service\lib\commands\build\index.js:69
            args[0][0].to = dest
                   ^

TypeError: Cannot read property '0' of undefined
    at config.plugin.tap.args (\node_modules\@vue\cli-service\lib\commands\build\index.js:69:20)
    at Object.tap (\node_modules\webpack-chain\src\Plugin.js:19:22)
    at api.chainWebpack.config (\node_modules\@vue\cli-service\lib\commands\build\index.js:68:33)
    at webpackChainFns.forEach.fn (\node_modules\@vue\cli-service\lib\Service.js:135:40)
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (\node_modules\@vue\cli-service\lib\Service.js:135:26)
    at Service.resolveWebpackConfig (\node_modules\@vue\cli-service\lib\Service.js:139:48)
    at PluginAPI.resolveWebpackConfig (\node_modules\@vue\cli-service\lib\PluginAPI.js:117:25)
    at api.registerCommand.args (\node_modules\@vue\cli-service\lib\commands\build\index.js:86:27)
    at Service.run (\node_modules\@vue\cli-service\lib\Service.js:129:28)
error An unexpected error occurred: "Command failed.
Exit code: 1

For comparison: vue-cli-service build --mode production --dest test works without any issues

@capsur capsur changed the title build with development & set dest folder fails build with development set & dest folder fails Apr 4, 2018
@capsur capsur changed the title build with development set & dest folder fails build with development mode set & dest folder fails Apr 4, 2018
@capsur
Copy link
Author

capsur commented Apr 4, 2018

Quickly checked, seems to be related to the fact that the copy-webpack-plugin is not configured for development builds => https://github.com/vuejs/vue-cli/blob/dev/packages/%40vue/cli-service/lib/config/app.js#L147

@bigteejay
Copy link

I too am experiencing the same issue.

package.json

//snip
 "scripts": {
    "dev": "vue-cli-service build --mode development --dest builds/dev",
//snip

npm run dev yields the same error as you reported.

I (however) have no luck when trying just vue-cli-service build --mode development --dest builds/dev (or just "... --dest dev" in case it was the path separator that was causing problems.)

Either reports the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants