firebase / firebase/firebase-tools

Hosting framework detection should work without npm install

Open
#5,156 0 comments 0 reactions 0 assignees View on GitHub
integration: web frameworks type: feature request
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

**firebase-tools:** 11.15.0

**Platform:** windows

### [REQUIRED] Test case

Try to deploy hosting with next.js code

### [REQUIRED] Steps to reproduce
Have a next.js repo, but don't run npm install, or delete all node-modules. Then run init or deploy hosting command.

### [REQUIRED] Expected behavior
still detect framework

### [REQUIRED] Actual behavior
doesn't detect framework.

This is because in
https://github.com/firebase/firebase-tools/blob/200ee7e8d7d62e6ff1c05e96cb120aabff02c237/src/frameworks/next/index.ts#L56, `getNextVersion` uses `npm list ...`, which looks at node_modules.

To fix this, can we run npm install before detecting the framework, or try to detect without using `node_modules`?

Contributor guide

Open the contributing guide

Research direction

Start in src/frameworks/next/index.ts at getNextVersion and reproduce with a Next.js repository that has no node_modules by running the hosting init or deploy command. Trace how npm list is used for framework detection; done means the CLI still detects the Next.js framework without an npm install.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
cli, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.