Comments (17)
Weird, seems to work in the test. I'll try to dig into this. Thanks for reporting!
from ember-cli-dotenv.
Thanks @fivetabley. I can only find info on the included hook and not config hook so sorry couldn't help. Look forward to the fix!
from ember-cli-dotenv.
@kenips can you try again with 0.3.0, and let me know what version of node and ember-cli you are using? thanks!
from ember-cli-dotenv.
Sorry @fivetanley no luck.
# ember -v
version: 0.1.2
node: 0.10.33
npm: 2.1.3
All I did was:
~# mkdir my-app
~# cd my-app
my-app# ember init
...
my-app# nom install ember-cli-dotenv --save-dev
my-app# ember server
version: 0.1.2
Cannot read property 'options' of undefined
...
from ember-cli-dotenv.
For me at config()
entry point console.log(Object.keys(this))
gives:
[ 'project',
'registry',
'_didRequiredBuildPackages',
'treePaths',
'treeForMethods' ]
from ember-cli-dotenv.
Try 0.3.1. I have no idea how I got this working in a different project before. Probably a fluke. if you look at 6353e4b you can see the change required to get this fixed.
I ran into the error in a new app, and upgrading it fixed it for me.
from ember-cli-dotenv.
yeah I was just looking at that - you sure that you can get dotEnv from appConfig? I didn't see that myself. whereas anything declared in environment.js would get passed down. So for me moving the whitelisting to environment.js as ENV['dot-env']
seems reasonable.
from ember-cli-dotenv.
yeah, the tests passed so i figured it was working. so clearly there's some work to do to get this working from the config hook. wish I could get at the app somehow... :\
from ember-cli-dotenv.
I rolled back the change for now, it seems it works in some people's apps but not others. I'll keep looking into it. :(
from ember-cli-dotenv.
0.3.3 is out and seems to fully work in my sample application. hope this fixes it for you @kenips
from ember-cli-dotenv.
Note that the first time you access process.env
may not have your environment variable the first time around as it gets merged with the first app config, then passed to all the addons like ember-cli-dotenv.
from ember-cli-dotenv.
@fivetanley it's not working for me. I see that you've added included block but that should be the default behavior anyway. I see the exact same error as first reported now.
from ember-cli-dotenv.
Hello! I have the same problem. I create a new dir, initialize ember, install ember-cli-dotenv from git repo and try to start ember server but I get this error:
➜ lala git:(master) ember s
version: 0.1.2
Cannot read property 'options' of undefined
TypeError: Cannot read property 'options' of undefined
at Class.module.exports.config (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli-dotenv/index.js:13:12)
at /home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/lib/models/project.js:99:27
at Array.reduce (native)
at Project.getAddonsConfig (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/lib/models/project.js:97:22)
at Project.config (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/lib/models/project.js:84:29)
at Class.module.exports.Command.extend.run (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/lib/commands/serve.js:26:29)
at Class.Command.validateAndRun (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/lib/models/command.js:86:15)
at /home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/lib/cli/cli.js:54:22
at $$$internal$$tryCatch (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:470:16)
at $$$internal$$invokeCallback (/home/vasilakisfil/Kollegorna/skl-related/lala/node_modules/ember-cli/node_modules/rsvp/dist/rsvp.js:482:17)
from ember-cli-dotenv.
0.3.4 is out and returns early if the addon gets included too early without the included
hook being called. seems to work ok for me, let me know if it works for you.
from ember-cli-dotenv.
Looks good to me! Thanks @fivetanley.
from ember-cli-dotenv.
\o/
from ember-cli-dotenv.
Works perfect! Thanks!
from ember-cli-dotenv.
Related Issues (20)
- FastBoot support HOT 10
- Picking a specific dotenv file via CLI param HOT 2
- Installing gives errors somekey is not defined
- ignore exports in variable defs HOT 1
- Make .env.production effective on ember s -prod HOT 1
- This addon is incompatible with [email protected]+ HOT 47
- Unable to install v2.0 HOT 2
- Ability to check for variable presence HOT 5
- `config/dotenv.js` does not respect environment assumed from `ember deploy prod` HOT 5
- Release a new version to npm? HOT 1
- path option doesn't behave well with ember-cli-deploy's development workflow HOT 9
- Started getting this.ui.warn error since yesterday HOT 1
- Installation fails with "Cannot read property 'clientAllowedKeys' of undefined" HOT 5
- Travis missing ENV vars HOT 2
- Use failOnMissingKey in CI build HOT 5
- The default lookup path of .env is not documented HOT 2
- Environment not recognized correctly while using ember build --prod HOT 2
- Fix CI HOT 1
- env vars not loaded in `.ember-cli.js` HOT 1
- Use for local development only HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-dotenv.