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

ng serve does not detect changes in routes #4345

Closed
aprades opened this issue Feb 2, 2017 · 6 comments · Fixed by #4384
Closed

ng serve does not detect changes in routes #4345

aprades opened this issue Feb 2, 2017 · 6 comments · Fixed by #4384

Comments

@aprades
Copy link

aprades commented Feb 2, 2017

Please provide us with the following information:

OS?

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

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.26
node: 6.9.5
os: win32 x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.4.5
@angular/compiler-cli: 2.4.5

Repro steps.

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

Added a new route in a working module:
const routes: Routes = [
{path: 'travesses', component: TravessesComponent},
{path: 'peres', component: TravessesComponent} <= this is the new one
];

The log given by the failure.

Normally this include a stack trace and some more information.

webpack: Compiling...
Hash: 1cb8464dd62798771354
Time: 476ms
chunk {0} main.bundle.js, main.bundle.map (main) 11.4 kB {2} [initial] [rendered]
chunk {1} styles.bundle.js, styles.bundle.map (styles) 9.96 kB {3} [initial]
chunk {2} vendor.bundle.js, vendor.bundle.map (vendor) 3.16 MB [initial]
chunk {3} inline.bundle.js, inline.bundle.map (inline) 0 bytes [entry]
webpack: Compiled successfully.

Accessing the route gets:

EXCEPTION: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'peres'
Error: Cannot match any routes. URL Segment: 'peres'
at ApplyRedirects.noMatchError (http://localhost:4200/vendor.bundle.js:85516:16) [angular]
at CatchSubscriber.selector (http://localhost:4200/vendor.bundle.js:85485:29) [angular]
at CatchSubscriber.error (http://localhost:4200/vendor.bundle.js:68724:31) [angular]
at MapSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at MapSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at MapSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at MapSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at MapSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at MapSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at LastSubscriber.Subscriber._error (http://localhost:4200/vendor.bundle.js:6711:26) [angular]
at LastSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]
at MergeAllSubscriber.OuterSubscriber.notifyError (http://localhost:4200/vendor.bundle.js:48223:26) [angular]
at InnerSubscriber._error (http://localhost:4200/vendor.bundle.js:91572:21) [angular]
at InnerSubscriber.Subscriber.error (http://localhost:4200/vendor.bundle.js:6685:18) [angular]

Mention any other details that might be useful.

After stopping ng serve and launching it again the route works as expected.


Thanks! We'll be in touch soon.

@danielsogl
Copy link
Contributor

Same as #4338

@aprades
Copy link
Author

aprades commented Feb 2, 2017

It doesn't work with @ngtools/[email protected]

With @ngtools/[email protected] it works fine.

@rubiktubik
Copy link

By me its not detecting changes to all .ts files.
Solved with installing @ngtools/[email protected]

hansl pushed a commit that referenced this issue Feb 3, 2017
…iles (#4384)

Fix WebpackCompilerHost's cache invalidation behavior on Windows
systems. Previously, no call to _resolve was made, causing paths with
backslashes not to match the file cache.

Fixes #4422
Fixes #4345
Fixes #4338
MRHarrison pushed a commit to MRHarrison/angular-cli that referenced this issue Feb 9, 2017
…iles (angular#4384)

Fix WebpackCompilerHost's cache invalidation behavior on Windows
systems. Previously, no call to _resolve was made, causing paths with
backslashes not to match the file cache.

Fixes angular#4422
Fixes angular#4345
Fixes angular#4338
@lihaibh
Copy link

lihaibh commented Mar 4, 2017

Did anyone try the fix "installing @ngtools/[email protected]" with hot module reloading?
It doesnt work well for me.. it refreshes the page anyway..

@guntram
Copy link

guntram commented Apr 3, 2017

i tried the @ngtools/[email protected], but it crashed the project, also tried "exclude": "node_modules" in the config, but there was no difference...
i am using win7.
i did not try the inotify thing, as my memory is already almost at its limit (webstorm taking 1-2gb).

asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
…iles (angular#4384)

Fix WebpackCompilerHost's cache invalidation behavior on Windows
systems. Previously, no call to _resolve was made, causing paths with
backslashes not to match the file cache.

Fixes angular#4422
Fixes angular#4345
Fixes angular#4338
@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.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants