Skip to content

TypeError: Cannot read property 'request' of undefined #683

Closed

Description

@diegohaz

Not sure if that's a webpack regression or html-webpack-plugin bug, but with the latest version of webpack (v2.6), it started to throw that error.

Stack trace: https://travis-ci.org/diegohaz/arc/builds/234991673#L427

Activity

  1. diegohaz commented on May 23, 2017

    @diegohaz
    Author

    Removing node_modules/html-webpack-plugin/node_modules/webpack folder in my project fixed the issue temporarily.

    Tried to fork this repo to see if I could fix it, but I couldn't even get tests to pass on a fresh install (even following instructions on https://github.com/jantimon/html-webpack-plugin#contribution).

  2. mastilver commented on May 24, 2017

    @mastilver
    Collaborator

    I couldn't even get tests to pass on a fresh install

    I just rerun test on CI, everything is fine...

  3. mastilver commented on May 24, 2017

    @mastilver
    Collaborator

    Upgrading to [email protected] didn't cause any issue on one of my project

    From what I can see, it looks like you have several version of webpack installed, can you run that for me and give me the output:

    yarn
    yarn ls webpack
    
  4. ocassio commented on May 24, 2017

    @ocassio

    In my case, there are several webpack versions indeed.
    The reason is favicons-webpack-plugin package.
    Not sure, why they didn't set webpack as peer dependency.

    yarn list v0.24.5
    ├─ [email protected]
    │  └─ [email protected]
    └─ [email protected]
    
  5. diegohaz commented on May 24, 2017

    @diegohaz
    Author

    image

  6. diegohaz commented on May 24, 2017

    @diegohaz
    Author

    Running webpack build causes this error:
    image

    If I remove node_modules/html-webpack-plugin/node_modules/webpack, everything works.

    It can be reproduced by cloning my repo https://github.com/diegohaz/arc, upgrading webpack to v2.6 (yarn upgrade webpack) and running yarn build.

  7. mastilver commented on May 24, 2017

    @mastilver
    Collaborator

    @diegohaz Can you run:

    yarn install
    yarn ls webpack
    
  8. mastilver commented on May 24, 2017

    @mastilver
    Collaborator
  9. diegohaz commented on May 24, 2017

    @diegohaz
    Author

    @mastilver yarn list webpack only shows production dependencies. yarn install also install development dependencies, which includes https://github.com/jantimon/html-webpack-plugin/blob/master/package.json#L54

  10. mastilver commented on May 24, 2017

    @mastilver
    Collaborator

    What I was trying to do with yarn install is to dedupe packages

    I'm not really an expert with yarn so I believe you ;)

    I will have a look at your repo tonight if I have some time

  11. diegohaz commented on May 24, 2017

    @diegohaz
    Author

    It could be something related to yarn. Don't know. I'm really confused.

  12. mastilver commented on May 24, 2017

    @mastilver
    Collaborator

    I believe it is but I wouldn't bet on it ;)

  13. diegohaz commented on May 24, 2017

    @diegohaz
    Author

    Removing node_modules and yarn.lock and running yarn again fixed the issue. A lot of diff on yarn.lock though. Not sure what happened, but the issue can be closed for me.

  14. ocassio commented on May 24, 2017

    @ocassio

    @mastilver Seems like there is one already, but it's kinda stuck:
    jantimon/favicons-webpack-plugin#48

  15. mastilver commented on May 24, 2017

    @mastilver
    Collaborator

    @diegohaz Great news! :)

    I'm closing it down then

    For future reference: this issue is caused by multiple version of webpack being installed
    Make sure you only have one instance by running npm ls webpack:

  16. lock commented on May 31, 2018

    @lock

    This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  17. locked as resolved and limited conversation to collaborators on May 31, 2018
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions