Skip to content

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

Closed

Description

@bdphil86

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.

Activity

  1. 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[/+] on Dec 12, 2016
  2. filipesilva commented on Dec 30, 2016

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

  3. aviramga commented on Feb 15, 2017

    @aviramga

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

    #goodnessSquad

  4. hansl commented on Feb 25, 2017

    @hansl
    Contributor

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

  5. angular-automatic-lock-bot commented on Sep 6, 2019

    @angular-automatic-lock-bot

    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.

  6. locked and limited conversation to collaborators on Sep 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort1: easy (hours)help wantedLabel noting an issue which the team is looking for contribution from the community to fixtype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions