Skip to content

--modern flag fails when chaining "copy" plugin #2542

@scottbedard

Description

@scottbedard

Version

3.0.3

Reproduction link

https://github.com/scottbedard/vue-cli-bug

Node and OS info

Node 8.9.4, Yarn 1.6.0, Windows 10

Steps to reproduce

Run yarn build:modern

What is expected?

The build should complete with no errors, and static assets should be copied to ./wwwroot

What is actually happening?

The build fails with the following output

$ vue-cli-service build --modern

-  Building legacy bundle for production... ERROR  TypeError: Cannot read property '__expression' of undefined
TypeError: Cannot read property '__expression' of undefined
    at Object.toConfig (C:\git\vue-cli-bug\node_modules\webpack-chain\src\Plugin.js:55:38)
    at clean.Object.assign.plugins.plugins.values.map.plugin (C:\git\vue-cli-bug\node_modules\webpack-chain\src\Config.js:129:61)
    at Array.map (<anonymous>)
    at module.exports.toConfig (C:\git\vue-cli-bug\node_modules\webpack-chain\src\Config.js:129:40)
    at Service.resolveWebpackConfig (C:\git\vue-cli-bug\node_modules\@vue\cli-service\lib\Service.js:218:34)
    at PluginAPI.resolveWebpackConfig (C:\git\vue-cli-bug\node_modules\@vue\cli-service\lib\PluginAPI.js:115:25)
    at module.exports (C:\git\vue-cli-bug\node_modules\@vue\cli-service\lib\commands\build\resolveAppConfig.js:34:25)
    at build (C:\git\vue-cli-bug\node_modules\@vue\cli-service\lib\commands\build\index.js:124:50)
    at api.registerCommand (C:\git\vue-cli-bug\node_modules\@vue\cli-service\lib\commands\build\index.js:50:13)
    at Service.run (C:\git\vue-cli-bug\node_modules\@vue\cli-service\lib\Service.js:203:12)
    at Object.<anonymous> (C:\git\vue-cli-bug\node_modules\@vue\cli-service\bin\vue-cli-service.js:36:9)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
error Command failed with exit code 1.

Building works as expected when the --modern flag is omitted, or when config.plugin('copy') is not called. Configuring other plugins also seems to work as expected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions