firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

Deploy Error

Open snvtac opened this issue 1 year ago • 20 comments

[REQUIRED] Environment info

firebase-tools: 13.34.0

Platform: Ubuntu

[REQUIRED] Test case

No

[REQUIRED] Steps to reproduce

Run FirebaseExtended/action-hosting-deploy@v0

[REQUIRED] Expected behavior

Deploy Success

[REQUIRED] Actual behavior

Deploy Error,

Output:

/usr/local/bin/npx firebase-tools@latest hosting:channel:deploy pr1380-haoqianli_aa-price-e --only dev --expires 20d --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:1249: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. (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/dataconnect/schemaMigration.js:5:25) 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'


Node.js v20.19.0

The process '/usr/local/bin/npx' failed with exit code 1 Retrying deploy with the --debug flag for better error output /usr/local/bin/npx firebase-tools@latest hosting:channel:deploy pr1380-haoqianli_aa-price-e --only dev --expires 20d --project *** --debug 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:1249: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. (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/dataconnect/schemaMigration.js:5:25) 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'


Node.js v20.19.0

The process '/usr/local/bin/npx' failed with exit code 1 Error: The process '/usr/local/bin/npx' failed with exit code 1

https://github.com/sql-formatter-org/sql-formatter/issues/845

snvtac avatar Mar 20 '25 08:03 snvtac

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

google-oss-bot avatar Mar 20 '25 08:03 google-oss-bot

Most likely related to this change in SQL-formatter, https://github.com/sql-formatter-org/sql-formatter/releases/tag/v15.5.0

The dependency in firebase-tools' package.json is "sql-formatter": "^15.3.0", so this might be happening on every fresh install of firebase-tools, including most CI pipeline runs too.

thrant avatar Mar 20 '25 08:03 thrant

We have the same issue

datadanne avatar Mar 20 '25 08:03 datadanne

Most likely related to this change in SQL-formatter, https://github.com/sql-formatter-org/sql-formatter/releases/tag/v15.5.0

The dependency in firebase-tools' package.json is "sql-formatter": "^15.3.0", so this might be happening on every fresh install of firebase-tools, including most CI pipeline runs too.

Yes, Saw it, SQL-formatter was updated 2 hours ago. so bad !

snvtac avatar Mar 20 '25 08:03 snvtac

So do we just wait for sql-formatter to fix it? is there anything else we can do?

inxendere avatar Mar 20 '25 08:03 inxendere

so we need sql-formatter fix it ? i saw an update 2h ago

TanhAltAi avatar Mar 20 '25 08:03 TanhAltAi

Getting this same issue

jemantilla avatar Mar 20 '25 08:03 jemantilla

Same issue here

LadislavFolta avatar Mar 20 '25 08:03 LadislavFolta

So do we just wait for sql-formatter to fix it? is there anything else we can do?

I think this is an online service and we can't solve it for now.

snvtac avatar Mar 20 '25 08:03 snvtac

Related questions: https://github.com/sql-formatter-org/sql-formatter/issues/845

snvtac avatar Mar 20 '25 08:03 snvtac

i am acing same issue today

hankadev avatar Mar 20 '25 08:03 hankadev

Same issue,

first happened in github action.

Then i did a fresh of firebase-tools locally, same issue on my local now.

Nakira avatar Mar 20 '25 08:03 Nakira

We fixed this by switching to installing the firebase-tools cli not from NPM but using the standalone binary:

curl -sL firebase.tools | bash

andreicoman-vsp avatar Mar 20 '25 08:03 andreicoman-vsp

Downgrading to version 13.0.2 fixes as well

sultson avatar Mar 20 '25 08:03 sultson

You can temporarily work around this by using a version such as v13.6.0, which was released before sql-formatter was introduced. Naturally, this is not a recommended solution. It may cause other problems.

It's best to wait for the firebase-tools to be fixed.

yosipy avatar Mar 20 '25 08:03 yosipy

We got our Github Actions working with this type of hack which creates a version where sql-formatter is downgraded back to latest working version, then installs that globally for the action runner, and gets subsequent firebase-tool calls to work again.

So from

run: npm install -g firebase-tools

to

  run: |
    mkdir -p /tmp/firebase-install
    cd /tmp/firebase-install
    echo '{"dependencies":{"firebase-tools":"latest"},"overrides":{"sql-formatter":"15.3.0"}}' > package.json
    npm install
    npm install -g $(pwd)/node_modules/firebase-tools

thrant avatar Mar 20 '25 09:03 thrant

Fixing: https://github.com/sql-formatter-org/sql-formatter/pull/846

snvtac avatar Mar 20 '25 09:03 snvtac

fixed!

inxendere avatar Mar 20 '25 09:03 inxendere

released! https://github.com/sql-formatter-org/sql-formatter/releases/tag/v15.5.1

KoheiKanagu avatar Mar 20 '25 09:03 KoheiKanagu

Thanks! Fix works!

leszekkrol avatar Mar 20 '25 09:03 leszekkrol