Skip to content

Angular 17 SSR deployment does not work on windows #6543

Closed

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

Activity

  1. added a commit that references this issue on Nov 25, 2023
    1cc4410
  2. sonallux commented on Nov 25, 2023

    @sonallux
    ContributorAuthor

    I have created a PR for this: #6544

  3. added 4 commits that reference this issue on Nov 28, 2023
    5379d78
    6d793f2
    e9be80f
    c2fe032
  4. added a commit that references this issue on Dec 1, 2023
    9f5d1ce
  5. added a commit that references this issue on Dec 14, 2023
    916a790
  6. added a commit that references this issue on Apr 26, 2024
    c4aaa7b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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