willviles / ember-useragent

An Ember addon for Fastboot-enabled UserAgent parsing via UAParser.js.
MIT License
37 stars 12 forks source link

Could not find module `ua-parser-js` #27

Closed mminkoff closed 6 years ago

mminkoff commented 6 years ago

Out of (as far as I can tell) nowhere, this started happening.

loader.js:247 Uncaught Error: Could not find module `ua-parser-js` imported from `ember-useragent/services/user-agent`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at requireModule (loader.js:24)
    at Class._extractDefaultExport (index.js:389)
    at Class.resolveOther (index.js:109)
    at Class.superWrapper [as resolveOther] (ember-utils.js:418)

ember-useragent@0.8.0 ember-source@2.18.2

Any suggestions? Thank you.

willviles commented 6 years ago

This is a known issue we're resolving at the moment in https://github.com/willviles/ember-useragent/issues/24.

ember install ember-cli-cjs-transform should fix!

mminkoff commented 6 years ago

Thanks for the quick reply! I suspected it was related to that but:

A. I didn't see this error referenced anywhere so I wasn't sure, and B. installing ember-cli-cjs-transform does not fix it.

willviles commented 6 years ago

Hmm, could this be related? https://github.com/rwjblue/ember-cli-cjs-transform/issues/91#issuecomment-420574110

mminkoff commented 6 years ago

I haven't seen any issues loading ember-resolver. I've had to remove ember-useragent for now. It's not mission critical, whereas a feature I'm working on is at the moment.

willviles commented 6 years ago

Nothing to do with ember-resolver, just potentially an issue with ember-cli-cjs-transform's tmp cache.

If you've got time to look at it again, try find $TMPDIR -type d -name '*cjs-transform*' -exec rm -rf {} +;. Thanks!

buschtoens commented 6 years ago

@mminkoff Also, if you have the time, please try to outline your setup. Does it differ from a "standard" app? Are you adding ember-useragent to an addon or engine maybe?

mminkoff commented 6 years ago

yes, I'm using it in an addon.

Subtletree commented 6 years ago

I was seeing this too, in a fairly standard app, not an addon. Also seeming to appear out of nowhere.

@willviles the fix you mentioned worked for me 🎉

ember-source 3.4.4 ember-useragent 0.8.0 ember-cli-cjs-transform 1.3.0

BMahabir commented 3 years ago

This issue is occurring for me in my application. The fix that @willviles suggests does not work for me. I wonder if @mminkoff ever solved this issue somehow? If so, would love to hear how -- in any case, this issue is real and still exists.


ember-cli: 3.6.1
node: 10.24.1
os: linux x64
[tnadmin@localhost erm3]$ npm -v
6.14.12```

user agent : 0.9.1
ua-parser-js : 0.7.31
ember-cli-cjs-transform : 1.3.0