Skip to content

import firebase version 8.6.4 cannot compile on npm install - react #4977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jun 4, 2021 · 14 comments · Fixed by #4982
Closed

import firebase version 8.6.4 cannot compile on npm install - react #4977

ghost opened this issue Jun 4, 2021 · 14 comments · Fixed by #4982

Comments

@ghost
Copy link

ghost commented Jun 4, 2021

  • Browser version: nodejs v14.17.0
  • Firebase SDK version: 8.6.4

Steps to reproduce: npm install firebase @8.6.4 and import firebase from "firebase" within react. on npm start, recieve "failed to compile" start error

when attempting to import firebase in React, I am met with the error below.

./node_modules/@firebase/firestore/dist/esm5/prebuilt-db9cc925-eb007c37.js
Attempted import error: 'FetchXmlHttpFactory' is not exported from '@firebase/webchannel-wrapper' (imported as 'v').

by removing the FetchXmlHttpFactory import within the referenced prebuilt file above, I can get Firebase to compile correctly within React.

@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@ghost ghost changed the title import firebase version 8.6.4 cannot compile on npm install import firebase version 8.6.4 cannot compile on npm install - react Jun 4, 2021
@armandabric
Copy link

armandabric commented Jun 4, 2021

I got the same issue when bundeling with vitejs my application with the version v8.6.4

$ vite
...
 > node_modules/@firebase/firestore/dist/esm5/prebuilt-db9cc925-eb007c37.js:5:110: error: No matching export in "node_modules/@firebase/webchannel-wrapper/dist/index.esm.js" for import "FetchXmlHttpFactory"
    5 │ ...eateWebChannelTransport as p, getStatEventTarget as y, FetchXmlHttpFactory as v, WebChannel as m, Event as g, Stat as w } from "...
      ╵                                                           ~~~~~~~~~~~~~~~~~~~

error when starting dev server:
Error: Build failed with 1 error:
node_modules/@firebase/firestore/dist/esm5/prebuilt-db9cc925-eb007c37.js:5:110: error: No matching export in "node_modules/@firebase/webchannel-wrapper/dist/index.esm.js" for import "FetchXmlHttpFactory"
    at failureErrorWithLog (/home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:1466:15)
    at /home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:1148:28
    at runOnEndCallbacks (/home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:938:63)
    at buildResponseToResult (/home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:1146:7)
    at /home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:1253:14
    at /home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:629:9
    at handleIncomingPacket (/home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:726:9)
    at Socket.readFromStdout (/home/armand/workspace/pepettes/node_modules/esbuild/lib/main.js:596:7)
    at Socket.emit (events.js:376:20)
    at addChunk (internal/streams/readable.js:309:12)
error Command failed with exit code 1.

Downgrading firebase to v8.6.3 resolve the issue

@dkocich
Copy link

dkocich commented Jun 4, 2021

same issue here with WIN10, [email protected], node 14.7.0, npm 6.14.11; it started working again after npm i [email protected] --save-exact

./node_modules/@firebase/firestore/dist/esm5/prebuilt-db9cc925-eb007c37.js
Attempted import error: 'FetchXmlHttpFactory' is not exported from '@firebase/webchannel-wrapper' (imported as 'v').

@rudenick0309
Copy link

rudenick0309 commented Jun 4, 2021

Same issue to me, I solved this problem
I did downgrade the firebase version to "firebase": "^8.4.1".
( maybe, the latest version of firebase is 8.6.4 or 8.6.1 )

@barakiva
Copy link

barakiva commented Jun 4, 2021

Downgraded to 8.4.3, 8.6.1, 2, and 3. Ran a clean install multiple times with npm ci. Still getting the same message.

@rudenick0309
Copy link

rudenick0309 commented Jun 4, 2021

@barakiva Did you delete about firebase packages in package-lock.json?

@schmidt-sebastian
Copy link
Contributor

We need to publish a new version of WebChannel Wrapper.

@barakiva
Copy link

barakiva commented Jun 4, 2021

@barakiva Did you delete about firebase packages in package-lock.json?

I deleted all of package-lock.json multiple times when NPM got stuck trying to degrade firebase. Still didn't work.

@schmidt-sebastian
Copy link
Contributor

I will see if we can publish the newer WebChannel Wrapper this morning, but in the meantime an older install of Firestore should work.

@ghost
Copy link
Author

ghost commented Jun 4, 2021

@schmidt-sebastian Thank you!

@ptxmac
Copy link

ptxmac commented Jun 4, 2021

A bit premature closing of the issue? The new package haven't been published yet: https://www.npmjs.com/package/@firebase/webchannel-wrapper

@schmidt-sebastian
Copy link
Contributor

We generally close issues once the necessary code changes are merged. I will ping this issue when the change is published.

@schmidt-sebastian
Copy link
Contributor

Package is published.

@nelson6e65
Copy link

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants