-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This addon is incompatible with [email protected]+ #30
Comments
Tried running addon tests, but they fail with |
OK, I've figured it out. The problem is caused by this PR in Before this PR, my app's After the PR, each is executed only once -- and Looks like, this addon's |
[email protected]
+
[email protected]
+
Uhm... Turns out I don't need this addon. O-o I replaced it with:
And it works correctly in |
Hi @lolmaus can you be more specific about that? I am upgrading ember-cli to 2.16 and this starts breaking. :( |
|
I think it would still be nice to fix this addon. Do you also notice the config is being corrected when you save the |
@rmachielse I am also experiencing the same problem. I would also greatly appreciate if someone would be able to fix this addon. |
I am facing the same issue as of ember-cli 2.16. |
For [email protected]+ we should use
This works fine and env variables listed in Following not gonna work for [email protected]+
@lolmaus could you please try following steps for your use case:
This will make env vars from your dotenv file available in the
|
Failing build is addressed in #29 |
@SergeAstapov I have tried making changes as you suggested. My ...
let app = new EmberApp(defaults, {
dotEnv: {
clientAllowedKeys: ['API_HOST', 'ASSET_HOST', 'REDIS_URL', 'SOCKET_URL',
'S3_BUCKET_NAME', 'AWS_REGION', 'AWS_ACCESS_KEY_ID', 'AWS_SECRET_ACCESS_KEY'],
path: {
development: '.env.development',
'development-postbuild': '.env.development'
}
},
fingerprint: {
prepend: process.env.ASSET_HOST,
enabled: true
},
... Things to note:
Edit:
still persists |
@sumeetattree are you able to access any of variables listed in
I actually was not using |
After running
Only after I hit save in
Yes this was working for |
@SergeAstapov while I can confirm that the values from our .env file gets added to environment config, we were previously using For example ember-intercom-api expects you to set the following: ENV['ember-intercom-api'] = {
appId: '[YOUR_APP_ID]'
}; and we were setting it as such: ENV['ember-intercom-api'] = {
appId: process.env.INTERCOM_APP_ID
}; Also we don't use .env files on our production server so we rely on accessing the info via process.env.XXX so that it works both during local development as well as on production. |
I was able to use @lolmaus fix, but unfortunately, it causes problems with A fix is needed for this package. I'm going to look into it. |
@SergeAstapov I tried your fix with |
@jamesdixon @jeanduplessis seems I do have a fix - as some extra caching has been implemented for Ember CLI, file Added fix to #29 that allows to access Could @jamesdixon @jeanduplessis you try it via |
@SergeAstapov thank you! I'll give it a shot |
@SergeAstapov unfortunately, this oddly still doesn't work for me. If I do a Any thoughts? |
@SergeAstapov i actually just reverted to the latest version of the original addon and am still seeing the behavior i mentioned above. that said, was your branch up to date or maybe just had no affect overall? I did add a logging statement to my
|
If I log out the contents of my |
@jamesdixon could you ping me in Slack? The same user name (sergeastapov) as on github. I wonder if I missing anything - it works fine for me and dummy app config seems to pass the test with no issues. Just FYI I'm not an addon maintainer, just was working on brining FastBoot support and at the same time Ember CLI was out and brought this issue. |
@SergeAstapov ember slack channel? Regarding the dummy app config, have you tried accessing |
@SergeAstapov unfortunately the fix on your branch isn't working for me. Here's the output from logging a process.env variable in config/environment.js: 1.2.0
SergeAstapov/ember-cli-dotenv#update-ember-cli
While the value is eventually set, when running your branch with the fix, unfortunately it doesn't seem to be set by the time Ember reads the values to write it to the meta tag on the index.html page. |
@jeanduplessis for some reason
After these steps do
And CLI console output would be:
If you then would do
and you would not see process.env.SOME_VAR_NAME variable value in meta tag in the dist/index.html file until you do some change and app is re-build. What is current addon behavior:read What was implemented in
|
@SergeAstapov thanks for all your effort on this. I'm likely going to have to consider some alternative approaches to dealing with our specific requirements. I think that in the light of your findings and improvements this issue can likely be closed off - maybe a note in the README file about not relying on process.env.XXX will suffice. |
@SergeAstapov I think that sounds fine. Maybe we should recommend using Would you or @lolmaus like commit bit/npm rights on this addon? I'm not actively using/working on it anymore. |
I have a fork going that moves the configuration out of ember-cli-build, which resolves this issue for now. https://github.com/jasonmit/ember-cli-dotenv Readme diff summarizes the changes: jasonmit@b055555#diff-04c6e90faac2675aa89e2176d2eec7d8 @fivetanley feel free to fold these changes in if you want. Otherwise I'll continue to maintain the fork for others. |
@fivetanley sounds good to me, would be glad to help! Approach suggested by @jasonmit with dotenv.js config file in project root seems solves the issue. @jasonmit was you able to access env name within |
@SergeAstapov I just released 2.0.1 to resolve this. Thanks for pointing that out. |
@jasonmit I added you and @SergeAstapov as collaborators on this repo. a 2.x release sounds great. It sounds like you have solved the issues on your fork? Feel free to merge those in. |
@jasonmit @SergeAstapov will you create a pull request and fix the issue here as well? |
@oxodesign changes are in master and will be published soon. |
PS: just to let you know I'm running master and its working beautifully. Thanks @jasonmit |
Good job people, a new release would be more than welcome. |
@fivetanley can you grant @SergeAstapov and myself npm access so we can cut a release? |
I suggest that we move |
When I run |
@lolmaus I'm also getting development instead of test. Explicitly setting the environment with |
Hi @lolmaus @jeanduplessis! Thanks for feedback! |
I have a addon that does set an key back to env. the code is: config: function(env, baseConfig) {
return {mySpecialKey: "test"}};
} Installed ember-cli-dotenv from master, did What can I do in this case? |
I was using |
@fivetanley can you grant @jasonmit and myself npm access so we can cut a release? |
@SergeAstapov @jasonmit thanks for the awesome work through this thread - was tracing a few subtle bugs for a while, finally realized it was dotenv, and stumbled on this thread. After upgrading and migrating, everything works again. Appreciate all the hard work! |
@SergeAstapov @jasonmit sorry for the delay, you both have publish rights on npm. thanks so much for your help |
Thank you @fivetanley! Version 2.0 has been pushed to npm! 🎉 Thank you all for the help, feedback and patience! |
Has anyone gotten this updated version to work properly with |
Hi.
SuddenlyAfter updating to[email protected]
,ember-cli-dotenv
stopped passing environment variables. Inconfig/environment.js
,process.env
does not contain env vars from the dot-env file.This happened to existing commits that have been working previously. My app uses Yarn with a proper lockfile, so I think it may be something with my OS.Please help me debug this and figure out the reason.The text was updated successfully, but these errors were encountered: