Giter VIP home page Giter VIP logo

Comments (17)

fivetanley avatar fivetanley commented on June 19, 2024

Weird, seems to work in the test. I'll try to dig into this. Thanks for reporting!

from ember-cli-dotenv.

kenips avatar kenips commented on June 19, 2024

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.

fivetanley avatar fivetanley commented on June 19, 2024

@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.

kenips avatar kenips commented on June 19, 2024

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.

kenips avatar kenips commented on June 19, 2024

For me at config() entry point console.log(Object.keys(this)) gives:

[ 'project',
  'registry',
  '_didRequiredBuildPackages',
  'treePaths',
  'treeForMethods' ]

from ember-cli-dotenv.

fivetanley avatar fivetanley commented on June 19, 2024

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.

kenips avatar kenips commented on June 19, 2024

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.

fivetanley avatar fivetanley commented on June 19, 2024

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.

fivetanley avatar fivetanley commented on June 19, 2024

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.

fivetanley avatar fivetanley commented on June 19, 2024

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.

fivetanley avatar fivetanley commented on June 19, 2024

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.

kenips avatar kenips commented on June 19, 2024

@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.

vasilakisfil avatar vasilakisfil commented on June 19, 2024

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.

fivetanley avatar fivetanley commented on June 19, 2024

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.

kenips avatar kenips commented on June 19, 2024

Looks good to me! Thanks @fivetanley.

from ember-cli-dotenv.

fivetanley avatar fivetanley commented on June 19, 2024

\o/

from ember-cli-dotenv.

vasilakisfil avatar vasilakisfil commented on June 19, 2024

Works perfect! Thanks!

from ember-cli-dotenv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.