mansona / ember-get-config

Get `config/environment` from anywhere, even addons!!!
MIT License
65 stars 20 forks source link

incompatible with ember-cli-app-version #47

Closed basz closed 2 years ago

basz commented 2 years ago

ember-cli-app-version changes the environment object; APP['version'] is set.

ember-get-config reads it before that change I think.

so in an app this works;

import config from '../config/environment';
console.log(config.APP['version']);

while this does not;

import config from 'ember-get-config';
console.log(config.APP['version']);

oooor,... i could be doing it wrong...

bertdeblock commented 2 years ago

This would be solved by https://github.com/mansona/ember-get-config/pull/45.

mansona commented 2 years ago

This should be fixed now in https://github.com/mansona/ember-get-config/releases/tag/v2.1.0 👍

basz commented 2 years ago

hi, i've tested a bit more.

When using embroider this still happens

bertdeblock commented 2 years ago

@basz That's because under Embroider, a compat adapter is used instead of ember-get-config itself. We should PR that the compat adapter is not used when embet-get-config >= v2.1 is detected I think.

bertdeblock commented 2 years ago

Forgot to mention, you can also disable the compat adapter in your project for now.

bertdeblock commented 2 years ago

Made https://github.com/embroider-build/embroider/pull/1224.

bertdeblock commented 2 years ago

The adapter is now disabled in Embroider v1.8.1: https://github.com/embroider-build/embroider/releases/tag/v1.8.1