Skip to content

Angular 17 SSR deployment does not work on windows #6543

Closed
@sonallux

Description

@sonallux

[REQUIRED] Environment info

firebase-tools: The current master branch with Commit 721c330

Platform: Windows

[REQUIRED] Test case

  • Generate a new Angular 17 SSR enabled application
  • Setup firebase deployment with the web frameworks feature
  • Add "firebase-tools": "firebase/firebase-tools#master", to your package.json and run npm install to use the current master branch

[REQUIRED] Steps to reproduce

  • Run npx firebase deploy on Windows
  • Open the browser and access our deployed app

[REQUIRED] Expected behavior

Running npx firebase deploy on Windows generates a valid Angular SSR function.

[REQUIRED] Actual behavior

Look at the Google Cloud Function Logs and find the following error. Note the slashes are missing. The required module is actually located at /workspace/dist/your-project-name/server/server.mjs

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/workspace/distyour-project-nameserver/server.mjs' imported from /workspace/bootstrap.js
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:327:11)
    at moduleResolve (node:internal/modules/esm/resolve:946:10)
    at defaultResolve (node:internal/modules/esm/resolve:1132:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ESMLoader.import (node:internal/modules/esm/loader:524:22)
    at importModuleDynamically (node:internal/modules/cjs/loader:1188:29)
    at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)

To verify this look at the bootstrap.js file in the .firebase/<your-project-id>/functions and see the path to the server.mjs
contains backslashes: ./dist\your-project-name\server/server.mjs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions