question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

firebase deploy --only functions = [ERR_UNSUPPORTED_ESM_URL_SCHEME]

See original GitHub issue

Environment info

firebase-tools: 9.16.5

Platform: Windows 10

Node: 14.17.3

NPM: 6.14.13

Package.json Dep:

Firebase: 8.9.1 @google-cloud/functions-framework: 1.9.0 firebase-functions: 3.15.4 Typescript: 4.3.5

Steps to reproduce

  1. Upgrade from node 10 to node 14 (update from commonJS to ESM).
  2. Attempt to deploy.

Expected behavior

The firebase functions to be deployed.

Actual behavior

Deploy fails while running pre-deploy script:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'

image

Additional info: The same is shown if I specify a single function. We had previously an issue with starting the emulators when initially updating to Node14 - this was resolved by #2994 / #3573 / #3574 (Thanks Daniel Lee!) I can start the emulators and use the functions locally.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
taeoldcommented, Aug 19, 2021

I will try to get the fix merged soon so that the bug is fixed by next CLI release.

In the meantime, if anyone is willing to test out the fix (I don’t have a Windows machine), I’d appreciate it:

> git clone https://github.com/firebase/firebase-tools.git
> cd firebase-tools
> git checkout origin/dl-cf3-esm-windows-fix2 
> npm i
> npm run build
> npm link # firebase cli should now point to locally built one
# cd to your functions project
> firebase deploy --only functions
0reactions
taeoldcommented, Nov 15, 2021

@PMLS3 Can you try running the latest CLI version (the change has been released for few months):

npm i -g firebase-tools
Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage functions | Cloud Functions for Firebase - Google
firebase deploy --only functions. By default, the Firebase CLI deploys all of the functions inside index.js at the same time. If your project...
Read more >
firebase deploy --only functions overrides existing functions
You can use firebase partial deploys $ firebase deploy --only functions:makeUppercase. Will only deploy makeUppercase function.
Read more >
Deploying 150+ functions is very slow - Google Groups
We run a large web app whose backend is hosted on Firebase Functions. ... Assuming this isn't the initial upload, you can of...
Read more >
haroldadmin/functions-differ: Tool to find Firebase ... - GitHub
This helps you selectively deploy only the functions that changed, thus saving time during re-deployments. It detects any changes to a function by...
Read more >
Optimizing Deployments for Cloud Functions - haroldadmin
Run the firebase deploy --only functions:[<function-names>] for the functions in each batch. Here's a simplified implementation of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found