-
Notifications
You must be signed in to change notification settings - Fork 257
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
cli: support catch all routes (i.e. to a custom 404 page) #31
Comments
@Splaktar I'm unable to reproduce this, and would love to debug this together with you. |
I restarted from scratch with |
Angular CLI: 9.0.0-rc.6
Node: 12.13.0
OS: darwin x64
Angular: 9.0.0-rc.6
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker
Ivy Workspace: Yes
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.900.0-rc.6
@angular-devkit/build-angular 0.900.0-rc.6
@angular-devkit/build-optimizer 0.900.0-rc.6
@angular-devkit/build-webpack 0.900.0-rc.6
@angular-devkit/core 9.0.0-rc.6
@angular-devkit/schematics 9.0.0-rc.6
@angular/cdk 9.0.0-rc.5
@angular/fire 5.2.3
@angular/material 9.0.0-rc.5
@ngtools/webpack 9.0.0-rc.6
@schematics/angular 9.0.0-rc.6
@schematics/update 0.900.0-rc.6
rxjs 6.5.3
typescript 3.6.4
webpack 4.41.2 As you can see above, I didn't mention that my app is a PWA. I'm not sure if that breaks Scully, but I'll try to disable |
However, I have SW disabled for dev builds like ServiceWorkerModule.register('ngsw-worker.js', {
enabled: environment.production,
registrationStrategy: 'registerWithDelay:5000'
}), |
Opening http://localhost:1864/ gives me a broken page with the following errors
For each of these failed resources, the server is sending back the contents of |
I see the same issue... nothing special in my test app. Generated a new ng8 app using the cli, Running I see lots of |
I wondering if there might be some dependance or issue with having Angular CLI version 8 installed globally, even if v9 is installed in the workspace. However, installing Angular CLI v9 globally didn't change anything. I also tried |
@Splaktar what routes do you have in your app? I've think I have discovered if you try adding a route with only a slug ( Similarly, looks like Kill the appropriate |
export const AppRoutes: Routes = [
{
path: '',
pathMatch: 'full',
component: AboutComponent,
children: []
},
{path: '**', component: PageNotFoundComponent}
]; |
I've noticed that the |
@Hypercubed this video covers how to set things up with the route parameters. However, I'm running into this issue w/o using any route params. |
Try removing the ** catch all.... |
That worked (after killing the Cleaned up /Users/splaktar/Git/.../dist/static/ folder.
started servers in background
servers available
Finding all routes in application.
Pull in data to create additional routes.
Route list created in files:
src/assets/scully-routes.json
/Users/splaktar/Git/.../dist/static/assets/scully-routes.json
Route "" rendered into file: "/Users/splaktar/Git/.../dist/static/index.html"
Route list created in files:
src/assets/scully-routes.json
/Users/splaktar/Git/.../dist/static/assets/scully-routes.json
Generating took 9.32 seconds for 1 pages:
That is 0.11 pages per second,
or 9327 milliseconds for each page. |
I'm pretty sure just need to move the scully/scully/utils/staticServer.ts Line 37 in 596d092
I haven't yet been able to build scully for dev so I can't test that. Edit: PR submitted. Tested locally. |
@Hypercubed Yes, that is part of the issue, but it seems to go a bit deeper. I have a PR in flight that will address this. But as I'm officially on holiday, I'm not entirely sure when I will be able to complete this one. Might be next year ☺ |
@SanderElias Are you able to share your PR? I'd like to test it if I can. |
the fix is in master :) |
Was this fixed in PR #146 or another PR? |
@Splaktar Yes, a partial fix might be in a bit earlier, but that one closed it completely. |
Steps to Reproduce
ng add @scullyio/init
npm i --save-dev fs-extra
ng build
npm run scully
Error
The debugger indicates that this is caused by the following line
scully/scully/utils/waitForServerToBeAvailable.ts
Line 13 in eba6fba
That URL (
http://localhost:1864/_pong
) seems to be returning my Angular app (in a broken state) rather than someJSON
content.Root Cause
A route like
{path: '**', component: PageNotFoundComponent}
breaks the ability to run Scully. Removing it works around the problem, but breaks the app's custom 404 page.The text was updated successfully, but these errors were encountered: