[BUG] npm package was not found (sql-formatter)
Action config
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: ${{ secrets.GITHUB_TOKEN }}
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
channelId: live
projectId: ....
Error message
Run FirebaseExtended/action-hosting-deploy@v0
Verifying firebase.json exists
Setting up CLI credentials
Deploying to production site
/usr/local/bin/npx firebase-tools@latest deploy --only hosting --project ... --json
npm warn exec The following package was not found and will be installed: [email protected]
node:internal/modules/cjs/loader:643
throw e;
^
Error: Cannot find module '/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/sql-formatter/dist/cjs/index.cjs'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1[24](https://github.com/..../actions/runs/13964637473/job/39092198105#step:12:27)9:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1237:15)
at resolveExports (node:internal/modules/cjs/loader:636:14)
at Module._findPath (node:internal/modules/cjs/loader:716:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1198:27)
at Module._load (node:internal/modules/cjs/loader:1043:27)
at Module.require (node:internal/modules/cjs/loader:1298:19)
at require (node:internal/modules/helpers:182:18)
at Object.<anonymous> (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/dataconnect/schemaMigration.js:5:[25](https://github.com/.../actions/runs/13964637473/job/39092198105#step:12:28))
at Module._compile (node:internal/modules/cjs/loader:1529:14) ***
code: 'MODULE_NOT_FOUND',
path: '/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/sql-formatter/package.json'
***
Expected behavior
Actual behavior
Same here and it only happens for the live deployment for some reason
@doum1004, @Hades32 , facing the same issue here.
Most probably something went wrong with sql-formatter dependency of https://github.com/firebase/firebase-tools, so maybe, the actual issue should be raised there.
From what I saw in firebase-tools repo, the sql-formatter seems to have been introduced somewhere after version 13.7.0.
So, for now I've been able to fix the deployment by explicitly setting firebaseToolsVersion to 13.7.0 in my workflow yaml files.
Hope seeing it fixed soon.
Thanks for the workaround!
The weird thing is that the latest version of this action did work before, so I guess it's a dub-dependency version pinning issue
Same here it's only happening in deployment
I could also reproduce it locally, when running the command via npx - npx firebase-tools@latest deploy
We also have this problem
Hey, same on my side and it only happens for the live deployment for some reason
related issues : https://github.com/firebase/firebase-tools/issues/8343
Fix incoming https://github.com/sql-formatter-org/sql-formatter/pull/846
Having the same problem