Skip to content

Webpack fails on initial compile but on second recompile it works #5823

@kevincam3

Description

@kevincam3

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.0.0
node: 7.8.0
os: win32 x64
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0
@angular/compiler-cli: 4.0.0

Repro steps.

Here's a link to a video of what I'm doing.
http://www.youtube.com/watch?v=gEm8Ju4ONDY

I start my app and it compiles with an error that seems to be related to a variable I declare.
Webpack initially compiles and gives an error but making any change to any file and re-saving it fixes the error.

The log given by the failure.

ERROR in Error encountered resolving symbol values statically. Reference to a local (non-exported) symbol 'toastr'. Consider exporting the symbol (position 25:13 in the original .ts file), resolving symbol AppModule in C:/wamp/www/angular4/src/app/app.module.ts
webpack: Failed to compile.

Desired functionality.

It should compile on the first time

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions