Skip to content
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

ERROR when using 'ng serve' with a ./config/environment.js path #3531

Closed
bdphil86 opened this issue Dec 12, 2016 · 4 comments
Closed

ERROR when using 'ng serve' with a ./config/environment.js path #3531

bdphil86 opened this issue Dec 12, 2016 · 4 comments

Comments

@bdphil86
Copy link

bdphil86 commented Dec 12, 2016

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.22-1
node: 7.2.0
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

No. This app was created using the CLI.
I added a 'config' directory to the root of my application with an 'environment.js' file inside. I use this file from 'server.js' to set env variable in my express app.

The log given by the failure.

Normally this include a stack trace and some more information.

C:\Users\brand\Desktop\projects\ng2-skeleton-node>ng serve
app.set is not a function
TypeError: app.set is not a function
at module.exports.app (C:\Users\brand\Desktop\projects\ng2-skeleton-node\config\environment.js:2:7)
at Project.config (C:\Users\brand\Desktop\projects\ng2-skeleton-node\node_modules\angular-cli\angular-cli\lib\models\project.js:198:52)
at C:\Users\brand\Desktop\projects\ng2-skeleton-node\node_modules\angular-cli\commands\serve.js:95:40
at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.

I renamed folder to 'configuration' and updated my references; this corrected the issue.


Thanks! We'll be in touch soon.

@bdphil86 bdphil86 changed the title ERROR when using 'ng serve' with a ./config/environment.js file ERROR when using 'ng serve' with a ./config/environment.js path Dec 12, 2016
@filipesilva
Copy link
Contributor

This sounds like some logic leftover from ember-cli that we do not use.

If someone wants to look at it, it's probably here somewhere:
https://github.com/angular/angular-cli/blob/master/packages/angular-cli/ember-cli/lib/models/project.js

There was some recent refactoring done in the forked ember code so this might or might not happen in the latest releases.

@aviramga
Copy link

@bdphil86 it looks like this issue was resolved by @gelliott181 so probably updating to the latest cli version would fix it.

#goodnessSquad

@hansl
Copy link
Contributor

hansl commented Feb 25, 2017

Thanks @aviramga. Closing this. If someone still has this issue on the latest release please open a new issue.

@hansl hansl closed this as completed Feb 25, 2017
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants