netlify / angular-runtime

The Angular Runtime allows Angular to run on Netlify with zero configuration
https://docs.netlify.com/integrations/frameworks/angular/
MIT License
18 stars 7 forks source link

Error deploying when not prerendering #100

Closed jdgamble555 closed 4 months ago

jdgamble555 commented 4 months ago

Describe the bug I don't want my front page prerendered, as I could have dynamic content there for SEO. I change prerender to false, and it will not deploy.

To Reproduce Steps to reproduce the behavior: Create a new Angular SSR project. Change projects.architect.prerender to false in angular.json. Then connect your Git Repository in Netlify and deploy.

Expected behavior It should deploy without error.

Versions

Logs

1:59:42 PM: Plugin "@netlify/angular-runtime" internal error              
1:59:42 PM: ────────────────────────────────────────────────────────────────
1:59:42 PM: ​
1:59:42 PM:   Error message
1:59:42 PM:   Error: ENOENT: no such file or directory, open "dist/angular-firebase-deploy/prerendered-routes.json"
1:59:42 PM: ​
1:59:42 PM:   Plugin details
1:59:42 PM:   Package:        @netlify/angular-runtime
1:59:42 PM:   Version:        2.0.5
1:59:42 PM:   Repository:     git+https://github.com/netlify/angular-runtime.git
1:59:42 PM:   npm link:       https://www.npmjs.com/package/@netlify/angular-runtime
1:59:42 PM:   Report issues:  https://github.com/netlify/angular-runtime/issues
1:59:42 PM: ​
1:59:42 PM:   Error location
1:59:42 PM:   In "onBuild" event in "@netlify/angular-runtime" from Netlify app
1:59:42 PM: ​
1:59:42 PM:   Error properties
1:59:42 PM:   {
1:59:42 PM:     errno: -2,
1:59:42 PM:     code: "ENOENT",
1:59:42 PM:     syscall: "open",
1:59:42 PM:     path: "dist/angular-firebase-deploy/prerendered-routes.json"
1:59:42 PM:   }
1:59:42 PM: ​
1:59:42 PM:   Resolved config
1:59:42 PM:   build:
1:59:42 PM:     command: npm run build
1:59:42 PM:     commandOrigin: ui
1:59:42 PM:     publish: /opt/build/repo/dist/angular-firebase-deploy/browser
1:59:42 PM:     publishOrigin: ui
1:59:42 PM:   plugins:
1:59:42 PM:     - inputs: {}
1:59:42 PM:       origin: ui
1:59:42 PM:       package: "@netlify/angular-runtime"
1:59:43 PM: Failed during stage "building site": Build script returned non-zero exit code: 4
1:59:43 PM: Build failed due to an internal system error: Build script returned non-zero exit code: 4
1:59:43 PM: Failing build: Failed to build site
1:59:43 PM: Finished processing build request in 36.601s

J

Skn0tt commented 4 months ago

Thanks for reporting! I'll work on a fix.

Skn0tt commented 4 months ago

Fix released in https://github.com/netlify/angular-runtime/releases/tag/v2.0.6. Let me know if that fixes it for you!

jdgamble555 commented 4 months ago

Still getting the error Error: ENOENT: no such file or directory, open "dist/angular-firebase-deploy/prerendered-routes.json". I'm not installing @angular-runtime, I'm just using the GitHub deploy.

If I set it to this:

"prerender": {
  "discoverRoutes": false
},

it works fine, but I shouldn't have to.

J

Skn0tt commented 4 months ago

Gotcha! I forgot that I also need to release the new version of the plugin to the Netlify infra, so it's applied to your site. Did that with https://github.com/netlify/plugins/pull/1310. Could you try again?

jdgamble555 commented 4 months ago

Yup, fixed it.

Thanks!

J