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

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

Closed
kevincam3 opened this issue Apr 4, 2017 · 5 comments
Closed

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

kevincam3 opened this issue Apr 4, 2017 · 5 comments

Comments

@kevincam3
Copy link

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

@kevincam3 kevincam3 changed the title Webpack fails on initial compile but not on second recompile it works Webpack fails on initial compile but on second recompile it works Apr 4, 2017
@filipesilva
Copy link
Contributor

Heya, thanks for filing this issue and making a video showing this problem happening.

This bug looks a lot like #4810 except it's happening for static analysis errors. It looks like #5489 missed that bit.

@filipesilva
Copy link
Contributor

To be clear though, the error you see is a real error, but the CLI is failing to report it on rebuilds.

@kevincam3
Copy link
Author

@filipesilva

Why is it a real error since I'm declaring the variable and it's a global variable being included in the index.html file?

@hansl hansl removed their assignment Feb 6, 2018
@filipesilva
Copy link
Contributor

Thanks for reporting this issue. This issue was originally reported a long time ago and since then we've had many releases, one of which might have addressed this problem. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

@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 Nov 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants