Skip to content

copy-webpack-plugin 2.1.4 fails #585

Closed

Description

@jmbarbier
  • I'm submitting a ...
    [x] bug report
    [ ] feature request
    [ ] question about the decisions made in the repository
  • Do you want to request a feature or report a bug?
    report a bug
  • What is the current behavior?

Failing to start webpack - copy-webpack-plugin issue : webpack/copy-webpack-plugin#46

forcing 2.1.3 makes it ok

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
  • clone angular2-webpack-starter
  • npm install
  • npm start
jmbarbier@iznogoud ~/D/s/angular2-webpack-starter> npm start

> angular2-webpack-starter@5.0.4 start /Users/jmbarbier/Devel/sandbox/angular2-webpack-starter
> npm run server:dev


> angular2-webpack-starter@5.0.4 server:dev /Users/jmbarbier/Devel/sandbox/angular2-webpack-starter
> webpack-dev-server --config config/webpack.dev.js --inline --progress --profile --colors --watch --display-error-details --display-cached --content-base src/

root directory: /Users/jmbarbier/Devel/sandbox/angular2-webpack-starter
(node) crypto.createCredentials is deprecated. Use tls.createSecureContext instead.
(node) crypto.Credentials is deprecated. Use tls.createSecureContext instead.

/Users/jmbarbier/Devel/sandbox/angular2-webpack-starter/config/webpack.common.js:232
    new CopyWebpackPlugin([{
    ^
TypeError: CopyWebpackPlugin is not a function
    at Object.<anonymous> (/Users/jmbarbier/Devel/sandbox/angular2-webpack-starter/config/webpack.common.js:232:5)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/jmbarbier/Devel/sandbox/angular2-webpack-starter/config/webpack.dev.js:7:22)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at module.exports (/Users/jmbarbier/Devel/sandbox/angular2-webpack-starter/node_modules/webpack/bin/convert-argv.js:80:13)
    at Object.<anonymous> (/Users/jmbarbier/Devel/sandbox/angular2-webpack-starter/node_modules/webpack-dev-server/bin/webpack-dev-server.js:55:48)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)

Activity

  1. CristyTarantino commented on May 13, 2016

    @CristyTarantino

    +1

  2. ditoglez commented on May 13, 2016

    @ditoglez

    +1
    As a temporary hack solution:

    var CopyWebpackPlugin = require('copy-webpack-plugin').default;

  3. vesteraas commented on May 13, 2016

    @vesteraas

    ...or setting copy-webpack-plugin version to "2.1.3"

  4. chief10 commented on May 13, 2016

    @chief10

    +1

    Except mine is like this:

    const CopyWebpackPlugin = (CopyWebpackPlugin = require('copy-webpack-plugin'), CopyWebpackPlugin.default || CopyWebpackPlugin);
                                                                                                    ^
    
    TypeError: Cannot read property 'default' of undefined
    
  5. jmbarbier commented on May 14, 2016

    @jmbarbier
    Author

    2.1.5 and 2.1.6 are pushed fixing this bug

  6. Mangesh-P commented on Jun 25, 2016

    @Mangesh-P

    @jmbarbier Is this still happening.
    I am still getting this error.

  7. phiphou commented on Jun 25, 2016

    @phiphou

    @Mangeshpimpalkar No, it should work, the project now use copy-webpack-plugin@3.0.1, witch is the latest stable version.

    Maybe you should try to delete and re-install this module :

    $ npm remove copy-webpack-plugin -D
    $ npm i copy-webpack-plugin -D

  8. PatrickJS commented on Jun 25, 2016

    @PatrickJS
    Owner

    ya it should work
    npm remove copy-webpack-plugin -D
    npm cache clean
    npm i copy-webpack-plugin -D

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions