mercredi 22 février 2023

Loader.js MissingModule at runtime after upgrading ember-auto-import to v2

My app is on v3.28 of Ember. After upgrading ember-auto-import from 1.12.0 to 2.6.0 (and adding webpack 5), I'm getting a missingModule error from loader.js for dependencies of my app's addons. I'm sure the issue is probably something that needs to be reconfiged in ember-cli-build, but i can't figure it out. Can somebody help point me in the right direction?

Instance of this error: Uncaught Error: Could not find module lodash.merge imported from ember-rollbar-client/services/rollbar

ember-rollbar-client: 0.9.0 -> lodash.merge: 4.6.1

Package versions: ember-cli: 3.28.6 node: 14.17.0 os: darwin arm64 ember-auto-import: 2.6.0 webpack: 5.75.0




mercredi 8 février 2023

CSS Images in EmberJS addons

I'd like to know the idiomatic way to reference css images (images linked in css through url(...) ) from within an Ember addon.

Ostensibly the addon public/ folder will get merged with dist/ in the final build and the css files will be merged with vendor.css

How can images therefore be linked i.e. if I have an image in /my-addon/public/images/icon.png how should I reference it in my CSS file? I've tried url(/my-addon/images/icon.png) and it doesn't respect the rootURL setting (only works if rootUrl = '/').

The only thing that seems to work is url(../my-addon/images/icon.png) but I've never heard mention that images should be linked with relative paths in this way.

Is there an established way to reference image assets from within addon css?

I've tried everything mentioned above but the only thing that works is relative paths. Am I correct to do so?




dimanche 5 février 2023

Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'

I've recently updated ember-cli and my app to 4.10.0, and trying to build with:

ember serve

throws the following error:

Cannot find module './transforms/babel-plugin-convert-existence-checks-to-macros'

I've looked to see what module is missing. I came up with trying to install/reinstall ember-cli-babel and that didn't work either.