ef4 / ember-browserify

ember-cli addon for easily loading CommonJS packages from npm via browserify.
MIT License
172 stars 28 forks source link

Cannot find module after upgrading to ember-cli 2.15 #122

Open abrinckm opened 6 years ago

abrinckm commented 6 years ago

The npm module I'm using is cytoscape v2.7.13.

This worked great before upgrading my ember from 2.8 to 2.15. At the time it was working fine, and I was using ember-browserify v1.1.13.

After upgrading ember-cli I followed up by upgrading ember-browserify: npm install ember-browserify@^1.2.0

My component still has this line at top: import cytoscape from "npm:cytoscape";

I have the following error:

Error: Could not find module 'npm:cytoscape' imported from 'ember-craft-repository/components/cyto-scape/component'
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at requireModule (loader.js:24)
    at Class._extractDefaultExport (index.js:392)
    at Class.resolveOther (index.js:113)
    at Class.superWrapper [as resolveOther] (ember-utils.js:423)
    at Class.resolve (resolver.js:164)
    at resolve (container.js:873)

Troubleshooting steps I have taken:

  1. Fresh install by: rm -rf tmp dist node_modules, npm cache clean, npm install
  2. I have tried moving the import directly under app/: in a new file app/cytoscape.js:
    import cytoscape from "npm:cytoscape";
    export default cytoscape;

    then in my component changed the line to import the above file. Resulted in the same error i.e. couldn't import npm:cytoscape

Again, this wasn't an issue before in ember-cli version 2.8 And this seems to be the only problem I'm experiencing after the upgrade.

abrinckm commented 6 years ago

Leaving a note here:

downgraded ember-cli to v2.14.2 downgraded ember-browserify to v1.1.13

and the problem goes away. This is probably an issue with ember-cli 2.15?

cloke commented 6 years ago

I just ran into the same problem. It happen right after I installed "ember-heatmap": "^1.0.2". Since it happened after the add-on was installed it is most likely an issue in that add-on, but I haven't verified. Downgrading fixed my issue as well.