Skip to content

[Webpack] Module not found: Error: Can't resolve 'vertx' in '/home/user/app/node_modules/plotly.js/dist' #2466

Closed

Description

@brussee

Error with plotly.js 1.35.1 and webpack 3.11.0 when importing: import Plotly from 'plotly.js/dist/plotly-with-meta'

./node_modules/plotly.js/dist/plotly-with-meta.js
Module not found: Error: Can't resolve 'vertx' in '/home/user/app/node_modules/plotly.js/dist'
 @ ./node_modules/plotly.js/dist/plotly-with-meta.js 61621:16-26
 @ ./src/entryPoint.js
 @ multi ./src/entryPoint.js webpack-hot-middleware/client?path=http://localhost:3000/__webpack_hmr

Activity

  1. brussee commented on Mar 9, 2018

    @brussee
    Author

    Exact same issue with ./node_modules/plotly.js/dist/plotly.min.js and ./node_modules/plotly.js/dist/plotly.js as well.
    Module not found: Error: Can't resolve 'vertx' in '/home/user/app/node_modules/plotly.js/dist'

  2. nicolaskruchten commented on Mar 9, 2018

    @nicolaskruchten
    Contributor

    Just to confirm: this is showing up as a warning, and compilation proceeds, right?

  3. chiaramdelucia commented on Mar 9, 2018

    @chiaramdelucia

    @nicolaskruchten I am having the same issue and yes, it is logging as a warning and compilation proceeds.

  4. chiaramdelucia commented on Mar 9, 2018

    @chiaramdelucia

    But, to note, I am now getting too many WebGL contexts in the console, where as before I wasn't. Not sure if this is related, but it did pop up with the 1.35.1 and this warning.

  5. etpinard commented on Mar 9, 2018

    @etpinard
    Contributor

    Not sure if this is related, but it did pop up with the 1.35.1 and this warning.

    That shouldn't be related. @chiaramdelucia would you mind sharing a reproducible example? Thank you!

  6. chiaramdelucia commented on Mar 9, 2018

    @chiaramdelucia

    @etpinard I didn't really think it would be, but thought I would note it JIC.

    As for reproducible code, here is a codepen. This isn't exactly what happens in my app, but it is similar. In the pen's console you'll see the following on the first button click, but not after that.
    Error: WebGL warning: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one.

    In my app, which uploads a dataset, it prints the following on the third time a dataset is uploaded.
    WARNING: Too many active WebGL contexts. Oldest context will be lost.

  7. etpinard commented on Mar 9, 2018

    @etpinard
    Contributor

    Hmm. I can't replicate. Can anyone else try out @chiaramdelucia 's codepen?

  8. chiaramdelucia commented on Mar 9, 2018

    @chiaramdelucia

    Oh, wow. Now I can't reproduce it either with that codepen. I'm sorry about that. I guess it must be something specific to application setup. Thanks for looking @etpinard.

  9. tsaiDavid commented on Mar 9, 2018

    @tsaiDavid

    I'm actually experiencing the same issue -

    WARNING in ./node_modules/plotly.js/dist/plotly.js
    Module not found: Error: Can't resolve 'vertx' in '/Users/***/node_modules/plotly.js/dist'
    

    plotly.js is on 1.35.2
    react-plotly.js is on 1.7.0

    I'm trying to test this in a development environment - we're using webpack@3.5.2

  10. hugograf commented on Mar 9, 2018

    @hugograf

    Since v1.35.x, I'am also get a huge warning. It is used in Angular (angular-cli) project:

    WARNING in ./node_modules/plotly.js/dist/plotly.js
    Module not found: Error: Can't resolve 'vertx' in 'C:\SoftwareProjekte\Hugos\grafioschtrader\grafioschtraderClient\node_modules\plotly.js\dist'
    resolve 'vertx' in 'C:\SoftwareProjekte\Hugos\grafioschtrader\grafioschtraderClient\node_modules\plotly.js\dist'
      Parsed request is a module
      using description file: C:\SoftwareProjekte\Hugos\grafioschtrader\grafioschtraderClient\node_modules\plotly.js\package.json (relative path: ./dist)
        Field 'browser' doesn't contain a valid alias configuration
      after using description file: C:\SoftwareProjekte\Hugos\grafioschtrader\grafioschtraderClient\node_modules\plotly.js\package.json (relative path: ./dist)
        resolve as module
    ...
    
  11. etpinard commented on Mar 9, 2018

    @etpinard
    Contributor

    The webpack issue has been confirmed. No need for anyone test it themselves. #2466 (comment) were referenring to another issue. Thanks.

  12. brussee commented on Mar 12, 2018

    @brussee
    Author

    Just to confirm: this is showing up as a warning, and compilation proceeds, right?

    Yes, webpack presents it as a warning and is able to complete the compilation.

  13. domehead100 commented on Mar 14, 2018

    @domehead100

    The error is from the es6 promise shim. Discussed here #100 and here #305.

    I had to add

    new webpack.IgnorePlugin(/vertx/)

    to my plugins to squelch the warning. Other things mentioned in the two discussions did not work. I'm still on webpack 3.10 and started getting this when updating to plotly.js 1.35.2 a few days ago.

  14. elshuku commented on Mar 28, 2018

    @elshuku

    experiencing the same issue during compile time. Application and Plotly components all work fine. For me it comes with another warning, which may or may not be related.

    WARNING in ./~/plotly.js/dist/plotly.js
    Critical dependencies:
    145202:31-39 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
     @ ./~/plotly.js/dist/plotly.js 145202:31-39
    
    WARNING in ./~/plotly.js/dist/plotly.js
    Module not found: Error: Can't resolve 'vertx' in '<project path>\node_modules\plotly.js\dist'
     @ ./~/plotly.js/dist/plotly.js 60182:16-26
    
    
  15. domehead100 commented on Mar 29, 2018

    @domehead100

    It is a prebuilt file. My recollection is that Uglify, which is smarter than webpack, was loading a module from es6 shim that was not transpiled, causing it to choke in release builds as soon as it encountered an es6 keyword such as let or const, or something like that. To mitigate this, react-plotly.js was tweaked to load the prebuilt file, which is all in es5. What bundler and version are you using?

  16. 1 remaining item

  17. etpinard commented on Apr 13, 2018

    @etpinard
    Contributor

    also related: #2400

  18. changed the title [-]Module not found: Error: Can't resolve 'vertx' in '/home/user/app/node_modules/plotly.js/dist'[/-] [+][Webpack] Module not found: Error: Can't resolve 'vertx' in '/home/user/app/node_modules/plotly.js/dist'[/+] on Apr 16, 2018
  19. nicolaskruchten commented on Apr 16, 2018

    @nicolaskruchten
    Contributor

    I've updated https://github.com/plotly/plotly-webpack to document the fact that the IgnorePlugin workaround is the recommended fix for now.

  20. added this to the v2.0.0 milestone on Dec 17, 2018
  21. jackparmer commented on Sep 10, 2020

    @jackparmer
    Contributor

    This issue has been tagged with NEEDS SPON$OR

    A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort.

    Sponsorship range: $10k-$15k

    What Sponsorship includes:

    • Completion of this feature to the Sponsor's satisfaction, in a manner coherent with the rest of the Plotly.js library and API
    • Tests for this feature
    • Long-term support (continued support of this feature in the latest version of Plotly.js)
    • Documentation at plotly.com/javascript
    • Possibility of integrating this feature with Plotly Graphing Libraries (Python, R, F#, Julia, MATLAB, etc)
    • Possibility of integrating this feature with Dash
    • Feature announcement on community.plotly.com with shout out to Sponsor (or can remain anonymous)
    • Gratification of advancing the world's most downloaded, interactive scientific graphing libraries (>50M downloads across supported languages)

    Please include the link to this issue when contacting us to discuss.

  22. archmoj commented on Jan 14, 2021

    @archmoj
    Contributor

    This might be fixed by #5358.

  23. modified the milestones: v2.0.0, NEXT on Jan 14, 2021
  24. alexcjohnson commented on Jan 14, 2021

    @alexcjohnson
    Collaborator

    Yes, @archmoj feel free to close this issue.

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

    bugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions