export ‘XhrIoPool’ was not found in ‘@firebase/webchannel-wrapper’

[REQUIRED] Describe your environment

  • Operating System version: MacOS 10.14.2
  • Browser version: 72.0.3626.119
  • Firebase SDK version: 4.6.2
  • Firebase Product: firestore

[REQUIRED] Describe the problem

I have a web application running firestore and everything works fine.

I started a new web project using the same base code, just added socket.io but I started to receive error messages.

Steps to reproduce:

firebase.initializeApp(FIREBASE_CONFIG);

export const db = firebase.firestore();

Output:
[WDS] Warnings while compiling.
/node_modules/@firebase/firestore/dist/esm/src/platform_browser/webchannel_connection.js 33:24-33 "export 'XhrIoPool' was not found in '@firebase/webchannel-wrapper'

Relevant Code:

Working code:
https://caminapp.herokuapp.com/#/google

Errors:
https://ryrapp.herokuapp.com/#/noticias/reportes

import * as firebase from 'firebase/app';
import 'firebase/firestore';
import 'firebase/auth';

import { FIREBASE_CONFIG } from '../../config';

firebase.initializeApp(FIREBASE_CONFIG);
const db = firebase.firestore();

const users = db.collection('users'); // Here

Output:
Firestore (4.10.1) 2019-03-14T07:45:02.623Z: INTERNAL UNHANDLED ERROR: TypeError: _firebase_webchannel_wrapper__WEBPACK_IMPORTED_MODULE_0__.XhrIoPool is not a constructor at new WebChannelConnection (http://localhost:9003/bundle.js:14047:21) at BrowserPlatform../node_modules/@firebase/firestore/dist/esm/src/platform_browser/browser_platform.js.BrowserPlatform.loadConnection (http://localhost:9003/bundle.js:13978:32) at FirestoreClient../node_modules/@firebase/firestore/dist/esm/src/core/firestore_client.js.FirestoreClient.initializeRest (http://localhost:9003/bundle.js:4913:14) at http://localhost:9003/bundle.js:4804:54

1 possible answer(s) on “export ‘XhrIoPool’ was not found in ‘@firebase/webchannel-wrapper’

  1. I don’t fully grok what’s going on, but I think the problem is basically that you’ve got references to two incompatible versions of webchannel-wrapper:

    +-- @firebase/webchannel-wrapper@0.2.16
    ...
    +-- firebase@4.12.1
    ...
    | +-- @firebase/firestore@0.3.7
    | | +-- @firebase/firestore-types@0.2.2
    | | +-- @firebase/logger@0.1.0 deduped
    | | +-- @firebase/webchannel-wrapper@0.2.7
    

    So presumably you’re ending up with @firebase/webchannel-wrapper@0.2.16 installed (I don’t know why) even though you’re using firebase@4.12.1 which needs @firebase/webchannel-wrapper@0.2.7 to work correctly. We removed XhrIoPool after 0.2.7, which is why you’re getting the error.

    If you can remove @firebase/webchannel-wrapper@0.2.16 or upgrade to a recent version of firebase which is compatible with 0.2.16, I think the problem will go away.

    @Feiyang1 I’m not sure if it would help or not, but perhaps we should bump webchannel-wrapper to 0.3.x? I made a breaking change in 0.2.14 but didn’t think it mattered, since @firebase/firestore pulls in the exact version that it depends on.

    @patricknasc If this problem reproduces for you even after wiping your node_modules and re-installing, can you share your package.json dependencies? Thanks!