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 on Netlify deploy #53

Closed alexbruno closed 5 months ago

alexbruno commented 2 years ago

Describe the bug It is not working properly, it raises an error in Netlify deploy.

To Reproduce Steps to reproduce the behavior:

  1. Apply the setup described in README to Angular project in netlify.toml file
  2. Push it to a Github repo with Netlify CI/CD to deploy
  3. Scroll down in the deploy log
  4. See the error:
...
10:48:06 PM: ./serverless.ts:10:0-54 - Error: Module not found: Error: Can't resolve 'mock-express-request' in '/opt/build/repo/site'
10:48:06 PM: ./serverless.ts:12:0-56 - Error: Module not found: Error: Can't resolve 'mock-express-response' in '/opt/build/repo/site'
10:48:06 PM: 
10:48:06 PM: ​
10:48:06 PM: ────────────────────────────────────────────────────────────────
10:48:06 PM:   "build.command" failed                                        
10:48:06 PM: ────────────────────────────────────────────────────────────────
10:48:06 PM: ​
10:48:06 PM:   Error message
10:48:06 PM:   Command failed with exit code 1: ng build && ng run site:serverless:production
10:48:06 PM: ​
10:48:06 PM:   Error location
10:48:06 PM:   In build.command from netlify.toml:
10:48:06 PM:   ng build && ng run site:serverless:production
10:48:06 PM: ​
10:48:06 PM:   Resolved config
10:48:06 PM:   build:
10:48:06 PM:     base: /opt/build/repo/site
10:48:06 PM:     command: ng build && ng run site:serverless:production
10:48:06 PM:     commandOrigin: config
10:48:06 PM:     publish: /opt/build/repo/site/dist/site/browser
10:48:06 PM:     publishOrigin: config
10:48:06 PM:   plugins:
10:48:06 PM:     - inputs: {}
10:48:06 PM:       origin: config
10:48:06 PM:       package: '@netlify/plugin-angular-universal'
10:48:06 PM:   redirects:
10:48:06 PM:     - from: /
10:48:06 PM:       status: 200
10:48:06 PM:       to: /index.html
10:48:06 PM:   redirectsOrigin: config
10:48:07 PM: Caching artifacts
...

Expected behavior Successful deployment of Universal Angular app to a serverless run into Netlify.

Versions

If you're using file-based installation

[build]
  base = 'site/'
  command = 'ng build && ng run site:serverless:production'
  publish = 'dist/site/browser'

[[plugins]]
  package = '@netlify/plugin-angular-universal'

[[redirects]]
  from ='/'
  to ='/index.html'
  status = 200
geometricpanda commented 1 year ago

Hey, i found a workaround for this is to use yarn, and to yarn add @netlify/plugin-angular-universal.

Skn0tt commented 5 months ago

Thanks for posting a workaround! I'm doing a little issue cleanup, and it seems like this one isn't relevant to v2 of this plugin anymore. Closing!