Coder Social home page Coder Social logo

netlify / angular-runtime Goto Github PK

View Code? Open in Web Editor NEW
19.0 6.0 11.0 3.68 MB

The Angular Runtime allows Angular to run on Netlify with zero configuration

Home Page: https://docs.netlify.com/integrations/frameworks/angular/

License: MIT License

JavaScript 100.00%
netlify netlify-plugin angular

angular-runtime's Introduction

Netlify Angular Runtime – Run Angular seamlessly on Netlify

Angular Runtime

This build plugin implements Angular Support on Netlify.

Table of Contents

Installation and Configuration

Netlify automatically detects Angular projects and sets up the latest version of this plugin. There's no further configuration needed from Netlify users.

Manual Installation

If you need to pin down this plugin to a fixed version, install it manually.

Create a netlify.toml in the root of your project. Your file should include the plugins section below:

[[plugins]]
  package = "@netlify/angular-runtime"

Install it via your package manager:

npm install -D @netlify/angular-runtime
# or
yarn add -D @netlify/angular-runtime

Read more about file-based plugin installation in our docs.

Accessing Request and Context during Server-Side Rendering

During server-side rendering (SSR), you can access the incoming Request object and the Netlify-specific Context object via providers:

import type { Context } from "@netlify/edge-functions"

export class FooComponent {

  constructor(
    // ...
    @Inject('netlify.request') @Optional() request?: Request,
    @Inject('netlify.context') @Optional() context?: Context,
  ) {
    console.log(`Rendering Foo for path ${request?.url} from location ${context?.geo?.city}`)
    // ...
  }
  
}

Keep in mind that these will not be available on the client-side or during prerendering.

To test this in local development, run your Angular project using netlify serve:

netlify serve

Limitations

  • The server.ts file that's part of the Angular scaffolding is meant for deploying to a VM, and is not compatible with this Netlify build plugin. If you applied changes to that file, you'll need to replicate them in an Edge Function. See (#135)[#135] for an example.

CLI Usage

Requirements

To use the Angular Runtime while building and deploying with the CLI, you need to have netlify-cli v17.0.0 installed (or a later version).

Please also make sure to use ntl deploy --build (rather than ntl build && ntl deploy).

Getting Help

We love to hear from you so if you have questions, comments or find a bug in the project, let us know! You can either:

Contributing

We welcome contributions ❤️ - see the CONTRIBUTING.md file for details.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

angular-runtime's People

Contributors

ascorbic avatar hrishikesh-k avatar jgantunes avatar lindsaylevine avatar mraerino avatar renovate-bot avatar renovate[bot] avatar serhalp avatar skn0tt avatar token-generator-app[bot] avatar tzmanics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

angular-runtime's Issues

[test] testing Linear integration

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Versions

  • Angular.js:
  • plugin (if installed in your package.json at fixed version):

If you're using the CLI to build

  • OS: [e.g. macOS, Windows]
  • netlify/cli version:

If you're using file-based installation

  • netlify.toml:

Angular 17 `browser` builder is not supported

Describe the bug
I am currently still using the browser builder with Angular 17. Unfortunately, the new Netlify Angular Runtime only supports the new application builder. So when deploying an Angular 17 app with the browser builder the following error message is show on the Netlify UI:

5:20:14 PM: Configuration error                                           
5:20:14 PM: ────────────────────────────────────────────────────────────────
5:20:14 PM: ​
5:20:14 PM:   Error message
5:20:14 PM:   Deploy did not succeed: Deploy directory "dist/angular-music/browser" does not exist

To Reproduce
Steps to reproduce the behavior:

  1. Create an Angular 17 app
  2. Switch to the old browser builder
  3. Deploy the app with netlify
  4. See this Error in the deploying step: Error message: Deploy did not succeed: Deploy directory "dist/angular-music/browser" does not exist

Expected behavior
I can deploy an Angular 17 app with the browser builder to Netlify

Versions

  • Angular: 17.0.4
  • plugin (if installed in your package.json at fixed version):

If you're using the CLI to build

  • OS: [e.g. macOS, Windows]
  • netlify/cli version:

If you're using file-based installation

  • netlify.toml:

Can't use normal Netlify functions when SSR enabled

Describe the bug
When using the SSR runtime, normal Netlify (non-edge) functions are not working. Not sure if this is by design but I don't have this problem when using Next.js. Normal functions are working fine when using SSR in my Next.js apps.

angular-runtime/src/helpers/setUpEdgeFunction.js

excludedPath: ${JSON.stringify(excludedPaths)},

Shouldn't the excludedPath include .netlify and possible other internal URLs of Netlify?

Everything redirects back to the app itself. I figured that because even without any redirect rules, app works fine whereas without a /* /index.html 200 redirect, direct access to any url should result with the Netlify's internal 404 page which it does for the non-SSR version.

To Reproduce
Example repo with a clean Angular v18 installation with SSR enabled and a single function.

It's deployed at https://vermillion-cat-89e180.netlify.app/

The function is deployed at https://vermillion-cat-89e180.netlify.app/.netlify/functions/hello but accessing it would render the app with an Error on the console that says there is no Route for the url because Angular tries to render the url.

I tried adding redirect rules but since SSR apps are not subject to redirect rules, they don't solve the problem.

--

Example repo without SSR but with exact same setup with the SSR one; Angular v18 and a single function.

The function is deployed at https://stellar-horse-4fc8e6.netlify.app/.netlify/functions/hello and works fine.

Expected behavior
I should be able to trigger normal functions when using SSR. As a workaround, I'm currently using edge functions since the ones that are defined in netlify.toml file triggered before the runtime but they are not versioned like normal functions so they are not really a replacement for normal functions.

Versions

  • Angular: v18.0.0
  • plugin: Latest, auto installed from Netlify's dashboard

If you're using the CLI to build

  • OS: [e.g. macOS, Windows]
  • netlify/cli version:

If you're using file-based installation

  • netlify.toml:

Accessing Request and Context during Server-Side Rendering doesn't work

Describe the bug
The section of the README.md that is titled "Accessing Request and Context during Server-Side Rendering" doesn't work.

To Reproduce
Default angular project following the blog post: https://www.netlify.com/blog/deploy-your-angular-v17-apps-to-netlify/

If anyone is still maintaining this repository I can provide a more elaborate project to reproduce

Expected behavior
It should allow me to log the geo.city and request url. Instead the @Inject doesn't provide any value. I suspect this is because the code here: https://github.com/netlify/angular-runtime/blob/main/src/helpers/setUpEdgeFunction.js#L109 calls the render function with "platformProvider:" but I think it should be "provider:".

Versions

        "@angular/animations": "^17.0.0",
        "@angular/common": "^17.0.0",
        "@angular/compiler": "^17.0.0",
        "@angular/core": "^17.0.0",
        "@angular/forms": "^17.0.0",
        "@angular/platform-browser": "^17.0.0",
        "@angular/platform-browser-dynamic": "^17.0.0",
        "@angular/platform-server": "^17.0.0",
        "@angular/router": "^17.0.0",
        "@angular/ssr": "^17.0.7",
        "@netlify/angular-runtime": "^2.0.4",
        "@netlify/edge-functions": "^2.2.0",

If you're using the CLI to build

  • OS: [e.g. macOS, Windows]
  • netlify/cli version:

If you're using file-based installation

  • netlify.toml:
[build]
  command = "npm run build"
  functions = "netlify/functions"
  publish = "dist/angular/browser"

[[plugins]]
  package="@netlify/angular-runtime"  

Server.ts changes are not being process after deploying to nelify but works fine locally

Describe the bug
Update my server.ts file to manage 301 redirect and added sanitization for json in final souuce code but both changes are not working, i can see its working locally but after deploying to netlify its not working

To Reproduce
Steps to reproduce the behavior:

  1. Make 301 redirects in server.ts file
function app(): express.Express {
  const server = express();
  const serverDistFolder = dirname(fileURLToPath(import.meta.url));
  const browserDistFolder = resolve(serverDistFolder, '../browser');
  const indexHtml = join(serverDistFolder, 'index.server.html');

  const commonEngine = new CommonEngine();

  server.set('view engine', 'html');
  server.set('views', browserDistFolder);

  server.get('*.*', express.static(browserDistFolder, {
    maxAge: '1y'
  }));
  

  server.get('*', (req, res, next) => {
    const { protocol, originalUrl, baseUrl, headers } = req;

    const redirectUrl = redirectMap[req.url];
    if (redirectUrl) {
      res.redirect(301, redirectUrl);
    }else{
      
    commonEngine
    .render({
      bootstrap,
      documentFilePath: indexHtml,
      url: `${protocol}://${headers.host}${originalUrl}`,
      publicPath: browserDistFolder,
      providers: [
        { provide: APP_BASE_HREF, useValue: baseUrl },
      ],
    })
    .then((html) => {
      
      // Extract the state
      const stateRegex = /<script id="ng-state" type="application\/json">(.*?)<\/script>/;
      const match = html.match(stateRegex);
      if (match && match[1]) {
        const state = JSON.parse(match[1]);  
        const sanitizedState = sanitizeState(state);        
        const serializedState = JSON.stringify(sanitizedState);
        // Replace the original state with the sanitized state
        html = html.replace(stateRegex, `<script id="ng-state" type="application/json">${serializedState}</script>`);
      }
      
      res.send(html);
      
    })
    .catch((err) => next(err));
    }

  });

  return server;
}

function run(): void {
  const port = process.env['PORT'] || 4000;

  const server = app();
  server.listen(port, () => {
    console.log(`Node Express server listening on http://localhost:${port}`);
  });
}

run();

redirectMap:

export const redirectMap: { [key: string]: string }  = {
'old url 1' :  'new url 1',
'old url 2' :  'new url 2',
'old url 3' :  'new url 3',
// other urls 
}

sanitize-state :

export function sanitizeState(state: any): any {
    const sanitizedState = JSON.parse(JSON.stringify(state));
  
    Object.keys(sanitizedState).forEach(key => {
      if (sanitizedState[key]?.u) {
        delete sanitizedState[key].u;
      }
    });
  
    return sanitizedState;
  }

Expected behavior
after deployment redirect should work but its not working and same for sanitize state

Versions

  • Angular.js: 18

If you're using the CLI to build
N/A

If you're using file-based installation

[build]
  command = "npm run build"
  publish = "dist/dapps/browser"

[[plugins]]
  package="@netlify/angular-runtime"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

reason for using redirect in server.ts because redirect is not supported in SSR and i have to redirect more than 3000 urls

Nx compatibility

Is your feature request related to a problem? Please describe.
I'm trying to deploy an angular app with ssr using nx and netlify and I get an error because it doesn't find the angular.json file, and that is because the file was renamed to project.json file.

Describe the solution you'd like
Allow to specify the angular.json name or try to find a project.json file.

Additional context

Plugin "@netlify/angular-runtime" failed                      
9:19:03 PM: ────────────────────────────────────────────────────────────────
9:19:03 PM: ​
9:19:03 PM:   Error message
9:19:03 PM:   Error: Could not locate your angular.json at your project root or two levels above your publish directory. Make sure your publish directory is set to "{PATH_TO_YOUR_SITE}/dist/{YOUR_PROJECT_NAME}/browser", where {YOUR_PROJECT_NAME} is 'defaultProject' in your angular.json.
9:19:03 PM: ​
9:19:03 PM:   Plugin details
9:19:03 PM:   Package:        @netlify/angular-runtime
9:19:03 PM:   Version:        2.1.0
9:19:03 PM:   Repository:     git+https://github.com/netlify/angular-runtime.git
9:19:03 PM:   npm link:       https://www.npmjs.com/package/@netlify/angular-runtime
9:19:03 PM:   Report issues:  https://github.com/netlify/angular-runtime/issues
9:19:03 PM: ​
9:19:03 PM:   Error location
9:19:03 PM:   In "onPreBuild" event in "@netlify/angular-runtime" from Netlify app
9:19:03 PM: ​
9:19:03 PM:   Resolved config
9:19:03 PM:   build:
9:19:03 PM:     command: nx run sanity-example:build
9:19:03 PM:     commandOrigin: ui
9:19:03 PM:     publish: /opt/build/repo/dist/apps/sanity-example
9:19:03 PM:     publishOrigin: ui
9:19:03 PM:   plugins:
9:19:03 PM:     - inputs: {}
9:19:03 PM:       origin: ui
9:19:03 PM:       package: '@netlify/angular-runtime'
9:19:03 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
9:19:04 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
9:19:04 PM: Failing build: Failed to build site

Error deploying when not prerendering

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

  • Angular.js: 17.2
  • plugin (if installed in your package.json at fixed version): n/a - Just connected Git Repository.

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

[security] Enforce Branch Protections

This is an issue generated by (for-internal-use-only)github-tools

Description

This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details

What do I need to do?

  • You can control whether or not branch protections are enforced by exclusively creating either of the labels:
    'enforce-branch-protections: true' or 'enforce-branch-protections: false'
  • If there is no branch protection control label, this issue will be recreated.
  • Once you have created either label, you can close this issue.
  • If you have issues or questions, please reach out to #internal-security-n-compliance on slack.

Can't use netlify.request

Describe the bug
I need to use the request info in my app, you say I can inject in my components constructor the netlify.request, and, for example, print on the console the request url, but where can I see that output running locally with netlify serve? Please help

To Reproduce
Steps to reproduce the behavior:

  1. I added the @Inject('netlify.request') @Optional() request?: Request, to the main component (AppComponent), the home page component and a service constructors:
constructor(
    // ...
    @Inject('netlify.request') @Optional() request?: Request,
    @Inject('netlify.context') @Optional() context?: Context,
  ) {
    console.log(`#request:`, request);
  }
  1. I run first with netlify serve, but no console output was shown. Then, I used netlify dev, and got path: undefined
    headers: undefined everywhere.

Expected behavior
Be able to obtain the request url and headers to extract info and use to SSR load data.

Versions

  • Angular.js: 18.0.0

If you're using the CLI to build

  • OS: Windows
  • netlify/cli version: 17.23.8

If you're using file-based installation

  • netlify.toml:

Error on Netlify deploy

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

  • Angular CLI: 13.2.2

If you're using file-based installation

  • netlify.toml:
[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

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined

Deploy Angular 17 SSR / SSG fails

Describe the bug
Hi there I generated a new Angular 17 application with the following command:

ng new my-app --ssr

I followed the instructions from this blog post: https://www.netlify.com/blog/deploy-your-angular-v17-apps-to-netlify/. Unfortunately I got the following error during deployment.

5:26:57 PM: Netlify Build                                                 
5:26:57 PM: ────────────────────────────────────────────────────────────────
5:26:57 PM: ​
5:26:57 PM: ❯ Version
5:26:57 PM:   @netlify/build 29.29.4
5:26:57 PM: ​
5:26:57 PM: ❯ Flags
5:26:57 PM:   baseRelDir: true
5:26:57 PM:   buildId: 656dfdadb754b6133966f29c
5:26:57 PM:   deployId: 656dfdadb754b6133966f29e
5:26:57 PM: ​
5:26:57 PM: ❯ Current directory
5:26:57 PM:   /opt/build/repo
5:26:57 PM: ​
5:26:57 PM: ❯ Config file
5:26:57 PM:   No config file was defined: using default values.
5:26:57 PM: ​
5:26:57 PM: ❯ Context
5:26:57 PM:   production
5:26:57 PM: ​
5:26:57 PM: ❯ Installing plugins
5:26:57 PM:    - @netlify/[email protected]
5:26:58 PM: ​
5:26:58 PM: ❯ Loading plugins
5:26:58 PM:    - @netlify/[email protected] from Netlify app
5:26:59 PM: ​
5:26:59 PM: @netlify/angular-runtime (onPreBuild event)                   
5:26:59 PM: ────────────────────────────────────────────────────────────────
5:26:59 PM: ​
5:26:59 PM: ​
5:26:59 PM: (@netlify/angular-runtime onPreBuild completed in 10ms)
5:26:59 PM: ​
5:26:59 PM: Build command from Netlify app                                
5:26:59 PM: ────────────────────────────────────────────────────────────────
5:26:59 PM: ​
5:26:59 PM: $ npm run build
5:26:59 PM: > [email protected] build
5:26:59 PM: > ng build
5:27:00 PM: - Building...
5:27:11 PM: An unexpected error occurred: [object Object]
5:27:11 PM: ​
5:27:11 PM: "build.command" failed                                        
5:27:11 PM: ────────────────────────────────────────────────────────────────
5:27:11 PM: ​
5:27:11 PM:   Error message
5:27:11 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
5:27:11 PM: ​
5:27:11 PM:   Error location
5:27:11 PM:   In Build command from Netlify app:
5:27:11 PM:   npm run build
5:27:11 PM: ​
5:27:11 PM:   Resolved config
5:27:11 PM:   build:
5:27:11 PM:     command: npm run build
5:27:11 PM:     commandOrigin: ui
5:27:11 PM:     publish: /opt/build/repo/dist/nothing-special/browser
5:27:11 PM:     publishOrigin: ui
5:27:11 PM:   plugins:
5:27:11 PM:     - inputs: {}
5:27:11 PM:       origin: ui
5:27:11 PM:       package: "@netlify/angular-runtime"
5:27:11 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:27:11 PM: Failing build: Failed to build site
5:27:12 PM: Failed during stage "building site": Build script returned non-zero exit code: 2
5:27:12 PM: Finished processing build request in 39.131s

To Reproduce
Steps to reproduce the behavior:

  1. Generate a new Angular application
  2. Push to repo
  3. Setup Netlify deployment with defaults
  4. See error in Deployment log on build step

Expected behavior
We deploy a Angular application with SSR and SSG (hypbrid)

Versions

  • Angular 17

Sentry integration

Is your feature request related to a problem? Please describe.

It's difficult to debug Angular SSR errors on Netlify Edge.

Sometimes, we see odd errors in the SSR Edge Function logs, e.g.:

Jun 25, 12:10:36 AM: 01J164T3 error  [Angular SSR] ERROR TypeError: Cannot read properties of undefined (reading 'get')
    at ho (file:///root/dist/sc-www/server/chunk-WQQCIBV7.mjs:193:2619)
    at e.ngOnInit (file:///root/dist/sc-www/server/chunk-WQQCIBV7.mjs:198:124362)
    at Yd (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:10817)
    at KD (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:10963)
    at Ph (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:10724)
    at ai (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:10452)
    at VE (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:41439)
    at sc (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:42495)
    at jE (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:41038)
    at $p (file:///root/dist/sc-www/server/chunk-L7LMYR6S.mjs:8:40931)

It runs fine when running the Angular app on localhost (with Express), but fails on Edge.
After painful shotgun debugging, we managed to figure out what is undefined on Edge,
and made adjustments in our codebase, but it would be much easier to get a proper traceback.

We tried to compile with source maps, but that did not improve the above traceback.

A potential solution might be submitting the error to Sentry where we can upload the source maps.

Describe the solution you'd like

It would be great to see a full traceback for debugging purposes. It could be in the Edge logs, or Sentry.

Describe alternatives you've considered

I don't think we can solve this without updates in angular-runtime. We tried to compile source maps in the PR preview deployments, but did not help the readability of the above traceback.

Additional context

See the above example error.

Change plugin name in toml example

Describe the bug
Wrong plugin name in the readme netlify.toml instructions.

Expected behavior
should be:
```toml`
[[plugins]]
package = "@netlify/plugin-angular-univeral"

angular v17 deployment on netlify fails after migrating from angular v16

Describe the bug
Recently migrated my website from angular v16 to angular v17 and when i am trying to deploy on netlify its looking for serverless directory and build fails with error

10:54:16 AM: ✘ [ERROR] Could not resolve "../../dist/dapps/serverless/main"
10:54:16 AM:     .netlify/functions-internal/angular-builder.js:3:27:
10:54:16 AM:       3 │ const { render } = require("../../dist/dapps/serverless/main")

logs

10:53:15 AM: build-image version: fcb0c1b3ada6d25c1cb58e8bc514f5f23cc14f15 (focal)
10:53:15 AM: buildbot version: fb93098f8bc97793cd0cfc3c46306bbf28bb04e9
10:53:15 AM: Fetching cached dependencies
10:53:15 AM: Starting to download cache of 329.3MB
10:53:18 AM: Finished downloading cache in 3.467s
10:53:18 AM: Starting to extract cache
10:53:21 AM: Finished extracting cache in 3.062s
10:53:21 AM: Finished fetching cache in 6.595s
10:53:21 AM: Starting to prepare the repo for build
10:53:22 AM: Preparing Git Reference refs/heads/main
10:53:24 AM: Starting to install dependencies
10:53:27 AM: Python version set to 3.8
10:53:27 AM: Attempting Ruby version 2.7.2, read from environment
10:53:28 AM: Using Ruby version 2.7.2
10:53:28 AM: Started restoring cached go cache
10:53:28 AM: Finished restoring cached go cache
10:53:30 AM: go version go1.19.13 linux/amd64
10:53:30 AM: Using PHP version 8.0
10:53:31 AM: Started restoring cached Node.js version
10:53:33 AM: Finished restoring cached Node.js version
10:53:33 AM: v20.11.1 is already installed.
10:53:33 AM: Now using node v20.11.1 (npm v10.2.4)
10:53:33 AM: Enabling Node.js Corepack
10:53:33 AM: Started restoring cached build plugins
10:53:33 AM: Finished restoring cached build plugins
10:53:33 AM: Started restoring cached corepack dependencies
10:53:33 AM: Finished restoring cached corepack dependencies
10:53:33 AM: No npm workspaces detected
10:53:33 AM: Started restoring cached node modules
10:53:33 AM: Finished restoring cached node modules
10:53:33 AM: Installing npm packages using npm version 10.2.4
10:53:34 AM: npm WARN using --force Recommended protections disabled.
10:53:35 AM: npm WARN ERESOLVE overriding peer dependency
10:53:35 AM: npm WARN ERESOLVE overriding peer dependency
10:53:35 AM: npm WARN ERESOLVE overriding peer dependency
10:53:35 AM: npm WARN While resolving: [email protected]
10:53:35 AM: npm WARN Found: @angular/[email protected]
10:53:35 AM: npm WARN node_modules/@angular/common
10:53:35 AM: npm WARN   @angular/common@"^17.2.3" from the root project
10:53:35 AM: npm WARN   17 more (@angular/cdk, @angular/forms, @angular/material, ...)
10:53:35 AM: npm WARN
10:53:35 AM: npm WARN Could not resolve dependency:
10:53:35 AM: npm WARN peer @angular/common@"^15.0.0" from [email protected]
10:53:35 AM: npm WARN node_modules/ngx-range
10:53:35 AM: npm WARN   ngx-range@"^5.0.0" from the root project
10:53:35 AM: npm WARN
10:53:35 AM: npm WARN Conflicting peer dependency: @angular/[email protected]
10:53:35 AM: npm WARN node_modules/@angular/common
10:53:35 AM: npm WARN   peer @angular/common@"^15.0.0" from [email protected]
10:53:35 AM: npm WARN   node_modules/ngx-range
10:53:35 AM: npm WARN     ngx-range@"^5.0.0" from the root project
10:53:35 AM: npm WARN ERESOLVE overriding peer dependency
10:53:35 AM: npm WARN While resolving: [email protected]
10:53:35 AM: npm WARN Found: @angular/[email protected]
10:53:35 AM: npm WARN node_modules/@angular/core
10:53:35 AM: npm WARN   @angular/core@"^17.2.3" from the root project
10:53:35 AM: npm WARN   20 more (@angular/animations, @angular/cdk, @angular/common, ...)
10:53:35 AM: npm WARN
10:53:35 AM: npm WARN Could not resolve dependency:
10:53:35 AM: npm WARN peer @angular/core@"^15.0.0" from [email protected]
10:53:35 AM: npm WARN node_modules/ngx-range
10:53:35 AM: npm WARN   ngx-range@"^5.0.0" from the root project
10:53:35 AM: npm WARN
10:53:35 AM: npm WARN Conflicting peer dependency: @angular/[email protected]
10:53:35 AM: npm WARN node_modules/@angular/core
10:53:35 AM: npm WARN   peer @angular/core@"^15.0.0" from [email protected]
10:53:35 AM: npm WARN   node_modules/ngx-range
10:53:35 AM: npm WARN     ngx-range@"^5.0.0" from the root project
10:53:36 AM: removed 77 packages, changed 2 packages, and audited 1162 packages in 2s
10:53:36 AM: 142 packages are looking for funding
10:53:36 AM:   run `npm fund` for details
10:53:36 AM: 1 moderate severity vulnerability
10:53:36 AM: Some issues need review, and may require choosing
10:53:36 AM: a different dependency.
10:53:36 AM: Run `npm audit` for details.
10:53:36 AM: npm packages installed
10:53:36 AM: Successfully installed dependencies
10:53:36 AM: Starting build script
10:53:39 AM: Detected 1 framework(s)
10:53:39 AM: "angular" at version "17.2.3"
10:53:39 AM: Section completed: initializing
10:53:40 AM: ​
10:53:40 AM: Netlify Build                                                 
10:53:40 AM: ────────────────────────────────────────────────────────────────
10:53:40 AM: ​
10:53:40 AM: ❯ Version
10:53:40 AM:   @netlify/build 29.36.3
10:53:40 AM: ​
10:53:40 AM: ❯ Flags
10:53:40 AM:   baseRelDir: true
10:53:40 AM:   buildId: 65f289b90bcbb10008d2bf0e
10:53:40 AM:   deployId: 65f289b90bcbb10008d2bf10
10:53:40 AM: ​
10:53:40 AM: ❯ Current directory
10:53:40 AM:   /opt/build/repo
10:53:40 AM: ​
10:53:40 AM: ❯ Config file
10:53:40 AM:   /opt/build/repo/netlify.toml
10:53:40 AM: ​
10:53:40 AM: ❯ Context
10:53:40 AM:   production
10:53:40 AM: ​
10:53:40 AM: ❯ Installing plugins
10:53:40 AM:    - @netlify/[email protected]
10:53:45 AM: ​
10:53:45 AM: ❯ Loading plugins
10:53:45 AM:    - @netlify/[email protected] from Netlify app
10:53:45 AM:    - @netlify/[email protected] from Netlify app
10:53:45 AM:    - @netlify/[email protected] from netlify.toml and package.json
10:53:46 AM: ​
10:53:46 AM: @netlify/plugin-angular-universal (onPreBuild event)          
10:53:46 AM: ────────────────────────────────────────────────────────────────
10:53:46 AM: ​
10:53:46 AM: FYI: You seem to be using a custom build script. Please make sure your script includes: ng build --configuration production && ng run dapps:serverless:production.
10:53:46 AM: ​
10:53:46 AM: (@netlify/plugin-angular-universal onPreBuild completed in 10ms)
10:53:46 AM: ​
10:53:46 AM: @netlify/angular-runtime (onPreBuild event)                   
10:53:46 AM: ────────────────────────────────────────────────────────────────
10:53:46 AM: ​
10:53:46 AM: ​
10:53:46 AM: (@netlify/angular-runtime onPreBuild completed in 8ms)
10:53:46 AM: ​
10:53:46 AM: build.command from netlify.toml                               
10:53:46 AM: ────────────────────────────────────────────────────────────────
10:53:46 AM: ​
10:53:46 AM: $ npm run build
10:53:46 AM: > [email protected] build
10:53:46 AM: > ng build
10:53:47 AM: Workspace extension with invalid name (defaultProject) found.
10:53:47 AM: - Building...
10:54:15 AM: Browser bundles
10:54:15 AM: Initial chunk files     | Names               |  Raw size | Estimated transfer size
10:54:15 AM: chunk-GURDAKQK.js       | -                   |   1.58 MB |               307.48 kB
10:54:15 AM: styles-QXFIZAFD.css     | styles              | 821.63 kB |                64.74 kB
10:54:15 AM: main-UBJ4YVCM.js        | main                | 302.38 kB |                68.79 kB
10:54:15 AM: scripts-KFSOFON6.js     | scripts             | 279.34 kB |                71.03 kB
10:54:15 AM: polyfills-BJX5WH5B.js   | polyfills           |  34.37 kB |                11.21 kB
10:54:15 AM: chunk-VH7USTTD.js       | -                   |   5.37 kB |                 2.16 kB
10:54:15 AM: chunk-P4FKFBKP.js       | -                   |   2.37 kB |               924 bytes
10:54:15 AM: chunk-E5U3H25K.js       | -                   | 722 bytes |               722 bytes
10:54:15 AM:                         | Initial total       |   2.99 MB |               527.03 kB
10:54:15 AM: Lazy chunk files        | Names               |  Raw size | Estimated transfer size
10:54:15 AM: chunk-CJ6S3GUO.js       | dashboard-module    | 578.94 kB |                94.39 kB
10:54:15 AM: chunk-AHZPBTJ4.js       | auth-module         | 419.50 kB |               127.70 kB
10:54:15 AM: chunk-XJO3DQFW.js       | landing-module      | 140.35 kB |                24.28 kB
10:54:15 AM: chunk-JQ6S3Z5L.js       | no-head-module      |  19.43 kB |                 5.22 kB
10:54:15 AM: chunk-KR6YVAMN.js       | faq-module          |  17.89 kB |                 5.29 kB
10:54:15 AM: chunk-X6ZHWL2S.js       | -                   |  10.91 kB |                 3.13 kB
10:54:15 AM: chunk-45RKVCWA.js       | -                   |   2.66 kB |               918 bytes
10:54:15 AM: chunk-S346P62U.js       | -                   | 494 bytes |               494 bytes
10:54:15 AM: Server bundles
10:54:15 AM: Initial chunk files     | Names               |  Raw size
10:54:15 AM: chunk-FW4N3BYD.mjs      | -                   |   1.35 MB | 
10:54:15 AM: server.mjs              | server              |   1.08 MB | 
10:54:15 AM: chunk-VLKPGHJO.mjs      | -                   | 296.22 kB | 
10:54:15 AM: polyfills.server.mjs    | polyfills.server    | 262.93 kB | 
10:54:15 AM: chunk-KLN4KM4T.mjs      | -                   | 249.24 kB | 
10:54:15 AM: chunk-RA3KNJJO.mjs      | -                   |  71.12 kB | 
10:54:15 AM: chunk-XJ6DZAGD.mjs      | -                   |   5.44 kB | 
10:54:15 AM: chunk-EZ6RW67L.mjs      | -                   |   2.40 kB | 
10:54:15 AM: chunk-UQQY2DYU.mjs      | -                   |   1.64 kB | 
10:54:15 AM: chunk-C4ZAJBE2.mjs      | -                   | 792 bytes | 
10:54:15 AM: main.server.mjs         | main.server         | 294 bytes | 
10:54:15 AM: render-utils.server.mjs | render-utils.server | 254 bytes | 
10:54:15 AM: Lazy chunk files        | Names               |  Raw size
10:54:15 AM: chunk-WKUJL5D5.mjs      | dashboard-module    | 579.04 kB | 
10:54:15 AM: chunk-OH2DF6LE.mjs      | auth-module         | 523.48 kB | 
10:54:15 AM: chunk-TN7YPEOT.mjs      | landing-module      | 140.45 kB | 
10:54:15 AM: chunk-PAPMBWUD.mjs      | no-head-module      |  19.52 kB | 
10:54:15 AM: chunk-WMPITBSN.mjs      | faq-module          |  17.99 kB | 
10:54:15 AM: chunk-WJYYDL5X.mjs      | xhr2                |  11.80 kB | 
10:54:15 AM: chunk-662NN2Z2.mjs      | -                   |  10.99 kB | 
10:54:15 AM: chunk-WM24H53W.mjs      | -                   |   2.73 kB | 
10:54:15 AM: chunk-NEWK7LEN.mjs      | -                   | 530 bytes | 
10:54:15 AM: Output location: /opt/build/repo/dist/dapps
10:54:15 AM: Application bundle generation complete. [28.488 seconds]
10:54:15 AM: 
10:54:15 AM: 
10:54:15 AM: ▲ [WARNING] Module "quill" used by "node_modules/primeng/fesm2022/primeng-editor.mjs" is not ESM
10:54:15 AM: 
10:54:15 AM:   CommonJS or AMD dependencies can cause optimization bailouts.
10:54:15 AM:   For more information see: https://angular.io/guide/build#configuring-commonjs-dependencies
10:54:15 AM: 
10:54:15 AM: 
10:54:15 AM: ▲ [WARNING] Module "ethereum-blockies-base64" used by "src/app/services/ethereum-avatar.service.ts" is not ESM
10:54:15 AM: 
10:54:15 AM:   CommonJS or AMD dependencies can cause optimization bailouts.
10:54:15 AM:   For more information see: https://angular.io/guide/build#configuring-commonjs-dependencies
10:54:15 AM: 
10:54:15 AM: 
10:54:15 AM: ▲ [WARNING] 3 rules skipped due to selector errors:
10:54:15 AM:   swiper-container::part(pagination) -> Pseudo-elements are not supported by css-select
10:54:15 AM:   .form-floating>~label -> Did not expect successive traversals.
10:54:15 AM:   .form-floating>~label -> Did not expect successive traversals.
10:54:15 AM: 
10:54:15 AM: 
10:54:15 AM: ​
10:54:15 AM: (build.command completed in 29.3s)
10:54:15 AM: ​
10:54:15 AM: @netlify/plugin-angular-universal (onBuild event)             
10:54:15 AM: ────────────────────────────────────────────────────────────────
10:54:15 AM: ​
10:54:16 AM: ​
10:54:16 AM: (@netlify/plugin-angular-universal onBuild completed in 62ms)
10:54:16 AM: ​
10:54:16 AM: @netlify/angular-runtime (onBuild event)                      
10:54:16 AM: ────────────────────────────────────────────────────────────────
10:54:16 AM: ​
10:54:16 AM: Writing Angular SSR Edge Function ...
10:54:16 AM: ​
10:54:16 AM: (@netlify/angular-runtime onBuild completed in 10ms)
10:54:16 AM: ​
10:54:16 AM: Functions bundling                                            
10:54:16 AM: ────────────────────────────────────────────────────────────────
10:54:16 AM: ​
10:54:16 AM: Packaging Functions from .netlify/functions-internal directory:
10:54:16 AM:  - angular-builder.js
10:54:16 AM: ​
10:54:16 AM: ✘ [ERROR] Could not resolve "../../dist/dapps/serverless/main"
10:54:16 AM:     .netlify/functions-internal/angular-builder.js:3:27:
10:54:16 AM:       3 │ const { render } = require("../../dist/dapps/serverless/main")
10:54:16 AM:         ╵                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10:54:16 AM: ​
10:54:16 AM: Dependencies installation error                               
10:54:16 AM: ────────────────────────────────────────────────────────────────
10:54:16 AM: ​
10:54:16 AM:   Error message
10:54:16 AM:   A Netlify Function failed to require one of its dependencies.
10:54:16 AM:   Please make sure it is present in the site"s top-level "package.json".
​
10:54:16 AM:   Build failed with 1 error:
10:54:16 AM:   .netlify/functions-internal/angular-builder.js:3:27: ERROR: Could not resolve "../../dist/dapps/serverless/main"
10:54:16 AM: ​
10:54:16 AM:   Resolved config
10:54:16 AM:   build:
10:54:16 AM:     command: npm run build
10:54:16 AM:     commandOrigin: config
10:54:16 AM:     environment:
10:54:16 AM:       - CI
10:54:16 AM:       - NPM_FLAGS
10:54:16 AM:     publish: /opt/build/repo/dist/dapps/browser
10:54:16 AM:     publishOrigin: config
10:54:16 AM:   functions:
10:54:16 AM:     "*":
10:54:16 AM:       included_files:
10:54:16 AM:         - dist/dapps/browser/index.html
10:54:16 AM:         - dist/dapps/browser/styles.css
10:54:16 AM:         - dist/dapps/browser/styles.css
10:54:16 AM:         - dist/dapps/browser/custom-theme.scss
10:54:16 AM:         - dist/dapps/browser/./node_modules/bootstrap/dist/css/bootstrap.min.css
10:54:16 AM:         - dist/dapps/browser/node_modules/primeng/resources/themes/lara-dark-teal/theme.css
10:54:16 AM:         - dist/dapps/browser/node_modules/primeng/resources/primeng.min.css
10:54:16 AM:         - dist/dapps/browser/node_modules/primeicons/primeicons.css
10:54:16 AM:         - dist/dapps/browser/node_modules/primeflex/primeflex.css
10:54:16 AM:       node_bundler: esbuild
10:54:16 AM:   plugins:
10:54:16 AM:     - inputs: {}
10:54:16 AM:       origin: ui
10:54:16 AM:       package: "@netlify/plugin-angular-universal"
10:54:16 AM:     - inputs: {}
10:54:16 AM:       origin: ui
10:54:16 AM:       package: "@netlify/plugin-lighthouse"
10:54:16 AM:     - inputs: {}
10:54:16 AM:       origin: config
10:54:16 AM:       package: "@netlify/angular-runtime"
10:54:16 AM:   redirects:
10:54:16 AM:     - from: /*
      status: 200
      to: /index.html
    - from: /*
      status: 200
      to: /.netlify/functions/angular-builder
  redirectsOrigin: inline
10:54:16 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
10:54:16 AM: Failing build: Failed to build site
10:54:17 AM: Finished processing build request in 1m1.815s

Expected behavior
It should deploy without error.

Versions

  • Angular.js: 17.2.3

If you're using the CLI to build
N/A

If you're using file-based installation

[build]
  command = "npm run build"
  publish = "dist/dapps/browser"

[[plugins]]
  package="@netlify/angular-runtime"

[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update angular-cli monorepo to v18.1.4 (@angular-devkit/build-angular, @angular/cli, @angular/ssr)
  • chore(deps): update dependency typescript to ~5.5.0
  • chore(deps): update dependency eslint-plugin-unicorn to v55
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency prettier to v3

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/failure-notifier.yml
  • smartcontractkit/chainlink-github-actions 75a9005952a9e905649cfb5a6971fd9429436acd
.github/workflows/labeler.yml
.github/workflows/release-please.yml
  • navikt/github-app-token-generator a3831f44404199df32d8f39f7c0ad9bb8fa18b1c
.github/workflows/stalebot.yml
.github/workflows/test.yml
npm
demo/package.json
  • @angular/animations ^18.0.1
  • @angular/common ^18.0.1
  • @angular/compiler ^18.0.1
  • @angular/core ^18.0.1
  • @angular/forms ^18.0.1
  • @angular/platform-browser ^18.0.1
  • @angular/platform-browser-dynamic ^18.0.1
  • @angular/platform-server ^18.0.1
  • @angular/router ^18.0.1
  • @angular/ssr ^18.0.2
  • @netlify/edge-functions ^2.9.0
  • express ^4.18.2
  • rxjs ~7.8.0
  • tslib ^2.3.0
  • zone.js ^0.14.3
  • @angular-devkit/build-angular ^18.0.2
  • @angular/cli ^18.0.2
  • @angular/compiler-cli ^18.0.1
  • @types/express ^4.17.21
  • @types/jasmine ~5.1.0
  • @types/node ^18.19.13
  • jasmine-core ~5.2.0
  • karma ~6.4.0
  • karma-chrome-launcher ~3.2.0
  • karma-coverage ~2.2.0
  • karma-jasmine ~5.1.0
  • karma-jasmine-html-reporter ~2.1.0
  • typescript ~5.4.5
package.json
  • fs-extra ^11.1.1
  • semver ^7.5.4
  • @netlify/eslint-config-node ^7.0.1
  • @types/node ^16.3.1
  • eslint-plugin-unicorn ^49.0.0
  • husky ^4.3.0
  • netlify-cli ^17.34.1
  • @netlify/build ^29.28.2
  • npm-run-all2 ^6.0.0
  • prettier ^2.1.2
  • node >=18.13.0
tests/fixtures/angular-17/package.json
  • express ^4.18.2
  • rxjs ~7.8.0
  • tslib ^2.3.0
  • zone.js ~0.14.3
  • @types/express ^4.17.17
  • @types/jasmine ~5.1.0
  • @types/node ^18.18.0
  • jasmine-core ~5.2.0
  • karma ~6.4.0
  • karma-chrome-launcher ~3.2.0
  • karma-coverage ~2.2.0
  • karma-jasmine ~5.1.0
  • karma-jasmine-html-reporter ~2.1.0
  • typescript ~5.4.0
tests/fixtures/application-builder/package.json
  • @angular/animations ^18.0.1
  • @angular/common ^18.1.0-rc
  • @angular/compiler ^18.1.0-rc
  • @angular/core ^18.1.0-rc
  • @angular/forms ^18.0.1
  • @angular/platform-browser ^18.1.0-rc
  • @angular/platform-browser-dynamic ^18.1.0-rc
  • @angular/router ^18.0.1
  • rxjs ~7.8.0
  • tslib ^2.3.0
  • zone.js ~0.14.2
  • @angular-devkit/build-angular ^18.0.2
  • @angular/cli ^18.0.2
  • @angular/compiler-cli ^18.1.0-rc
  • @types/jasmine ~5.1.0
  • jasmine-core ~5.2.0
  • karma ~6.4.0
  • karma-chrome-launcher ~3.2.0
  • karma-coverage ~2.2.0
  • karma-jasmine ~5.1.0
  • karma-jasmine-html-reporter ~2.1.0
  • typescript ~5.4.5
tests/fixtures/browser-builder/package.json
  • @angular/animations ^18.0.1
  • @angular/common ^18.1.0-rc
  • @angular/compiler ^18.1.0-rc
  • @angular/core ^18.1.0-rc
  • @angular/forms ^18.0.1
  • @angular/platform-browser ^18.1.0-rc
  • @angular/platform-browser-dynamic ^18.1.0-rc
  • @angular/router ^18.0.1
  • rxjs ~7.8.0
  • tslib ^2.3.0
  • zone.js ~0.14.2
  • @angular-devkit/build-angular ^18.0.2
  • @angular/cli ^18.0.2
  • @angular/compiler-cli ^18.1.0-rc
  • @types/jasmine ~5.1.0
  • jasmine-core ~5.2.0
  • karma ~6.4.0
  • karma-chrome-launcher ~3.2.0
  • karma-coverage ~2.2.0
  • karma-jasmine ~5.1.0
  • karma-jasmine-html-reporter ~2.1.0
  • typescript ~5.4.5
tests/fixtures/missing-angular-deps/package.json
tests/fixtures/non-angular-project/package.json
  • @angular/animations ^18.0.1
  • @angular/common ^18.1.0-rc
  • @angular/compiler ^18.1.0-rc
  • @angular/core ^18.1.0-rc
  • @angular/forms ^18.0.1
  • @angular/platform-browser ^18.1.0-rc
  • @angular/platform-browser-dynamic ^18.1.0-rc
  • @angular/platform-server ^18.1.0-rc
  • @angular/router ^18.0.1
  • @angular/ssr ^18.0.2
tests/fixtures/prerender-false/.netlify/plugins/package.json
tests/fixtures/prerender-false/package.json
  • @angular/animations ^18.0.1
  • @angular/common ^18.1.0-rc
  • @angular/compiler ^18.1.0-rc
  • @angular/core ^18.1.0-rc
  • @angular/forms ^18.0.1
  • @angular/platform-browser ^18.1.0-rc
  • @angular/platform-browser-dynamic ^18.1.0-rc
  • @angular/platform-server ^18.1.0-rc
  • @angular/router ^18.0.1
  • @angular/ssr ^18.0.2
  • express ^4.18.2
  • rxjs ~7.8.0
  • tslib ^2.3.0
  • zone.js ~0.14.3
  • @angular-devkit/build-angular ^18.0.2
  • @angular/cli ^18.0.2
  • @angular/compiler-cli ^18.1.0-rc
  • @types/express ^4.17.17
  • @types/jasmine ~5.1.0
  • @types/node ^18.18.0
  • jasmine-core ~5.2.0
  • karma ~6.4.0
  • karma-chrome-launcher ~3.2.0
  • karma-coverage ~2.2.0
  • karma-jasmine ~5.1.0
  • karma-jasmine-html-reporter ~2.1.0
  • typescript ~5.4.5

  • Check this box to trigger a request for Renovate to run again on this repository

Can't deploy with Firebase

Describe the bug
If I add Firebase to my project, it will not deploy.

To Reproduce
Steps to reproduce the behavior:

  1. Create a test project in Angular. Deploy it.
  2. Add firebase ng add @angular/fire
  3. Try to redeploy

Expected behavior
It should deploy without problems.

Versions

  • Angular.js: 17.2
  • plugin (if installed in your package.json at fixed version): using GitHub to connect

Error:

There was an error when loading the "crypto" npm module. Support for npm modules in edge functions
 is an experimental feature. Refer to https://ntl.fyi/edge-functions-npm for more information.

I know Firebase works, because I have deployed the exact same project to netlify edge using SvelteKit and Analog (which uses Angular):

So there should be a way to get it to work.

J

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.