Skip to content

Bug: Post-install script fails in VS Code Dev Container, subpath exports not created #1726

@Delta161

Description

@Delta161

Steps to reproduce

Environment:

OS: Standard VS Code Dev Container (Debian base)

Node.js version: 20.x

firebase-functions version: 5.0.1 and latest

Related issues

[REQUIRED] Version info

node:
v20.19.2

firebase-functions:
firebase-functions version: 5.0.1 and latest

firebase-tools:

firebase-admin:

[REQUIRED] Test case

When running npm install or yarn on the firebase-functions package (v5.x or latest) inside a standard VS Code Dev Container, the installation completes but the necessary proxy files for subpath imports (e.g., auth.d.ts, https.d.ts) are not created in the package's root. This leads to compile-time errors (TS2307: Cannot find module 'firebase-functions/auth') and runtime errors (ERR_PACKAGE_PATH_NOT_EXPORTED).

[REQUIRED] Steps to reproduce

Create a new project in a VS Code Dev Container using the official "Node.js & TypeScript" definition (using Node 20).

Create a functions directory.

Inside functions, create a package.json with the following content:

JSON

{
"name": "functions",
"main": "lib/index.js",
"engines": { "node": "20" },
"dependencies": {
"firebase-admin": "latest",
"firebase-functions": "latest"
},
"devDependencies": {
"typescript": "latest"
}
}
Run npm install (or yarn).

Run ls -l node_modules/firebase-functions/auth.d.ts.

[REQUIRED] Expected behavior

The ls command should show the file auth.d.ts.

[REQUIRED] Actual behavior

The ls command fails with No such file or directory

Were you able to successfully deploy your functions?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions