Closed bertdeblock closed 2 years ago
So it turns out, what you're identifying is actually a bug in the compat code in embroider rather than any code in this repo. This code assumes only the config file in the host app, not the actual exported module that may contain the combined configs from all the addons https://github.com/embroider-build/embroider/blob/main/packages/compat/src/compat-adapters/ember-get-config.ts
I'm a little bit swamped this week but I'll try to open a conversation with @ef4 to see what can be done but from @alexlafroscia comment in that file I would suspect that this might not be a solvable problem in the embroider world 🤔
At the moment, disabling the compat adapter for ember-get-config
actually breaks everything:
Uncaught Error: Cannot find module '<app-name>/config/environment'
Requiring the module instead of using importSync
works, though I'm unsure if that is "the fix".
EDIT: Made https://github.com/mansona/ember-get-config/pull/43 to disable the compat adapter during CI.
this was included in #45
Hopefully, this should illustrate that the config returned by
ember-get-config
is incorrect under Embroider (it seems this was also the case in v1 ofember-get-config
).ember-get-config
seems to only return what's defined inconfig/environment.js
and not what actually ends up in<app-name>/config/environment
or in the app's meta tag (e.g. including additional default config coming from addons).The
baz
in-repo addon is probably not ideal, but works to showcase the issue.