1

My client code written in React was working just minutes ago and it suddenly stopped working. I can't figure it out. What I have done is just delete contents of 'README.md'. Can anyone help me on this problem? I got the error below after running 'yarn start'.

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

I have attached package.json just in case.

{
  "name": "100xhunt",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/core": "^7.13.15",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "axios": "^0.21.1",
    "bootstrap": "^4.6.0",
    "charenc": "0.0.2",
    "crypt": "0.0.2",
    "dotenv": "^9.0.2",
    "firebase": "^8.6.2",
    "gsap": "^3.6.1",
    "jquery": "^3.6.0",
    "jwt-decode": "^3.1.2",
    "lodash": "^4.17.21",
    "lzma": "^2.3.2",
    "pako": "^2.0.3",
    "react": "^17.0.2",
    "react-bootstrap": "^1.6.0",
    "react-datepicker": "^3.8.0",
    "react-device-detect": "^1.17.0",
    "react-dom": "^17.0.2",
    "react-firebaseui": "^5.0.2",
    "react-icons": "^4.2.0",
    "react-redux": "^7.2.3",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.3",
    "react-select": "^4.3.0",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "stats-js": "^1.0.1",
    "styled-components": "^5.2.3",
    "three": "^0.94.0",
    "three-css2drender": "^1.0.0",
    "three-obj-loader": "^1.1.3",
    "three-objmtll-loader": "^1.0.1",
    "web-vitals": "^1.0.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ],
  }
}

My project was working fine minutes ago. I will appreciate your help.

RobC
  • 22,977
  • 20
  • 73
  • 80
  • Did you check Q/A on SO like these: https://stackoverflow.com/questions/53328408/receiving-attempted-import-error-in-react-app ? – Luuk Jun 04 '21 at 06:05
  • Thank you for your answer. What I did was to remove all the modules and lock file and installed packages again. The original project works fine but after I remove and install packages again, it stops working. – Top-Dev-Ops Jun 04 '21 at 06:25
  • 1
    this is a bug in `@angular/fire` pakage. when i dont import `AngularFirestoreModule` in the project everything works – Harkal Jun 06 '21 at 01:58

3 Answers3

1
  1. delete node_modules folder
  2. delete package-lock.json
  3. run npm i to re-install all packages
  4. install package @firebase/webchannel-wrapper by npm i @firebase/webchannel-wrapper --save

hope it works it worked for me

Harkal
  • 1,770
  • 12
  • 28
1

Had the same problem, and thanks to @Harkal for answering the question, but

I didn't delete node module + package-lock.json,

I just ran npm i @firebase/webchannel-wrapper --save

It worked for me just fine

0

I have fixed my problems by installing the old version of the npm package instead of the new version. I didn't delete node module + package-lock.json, I have an old version of (npm i html-to-text@7.1.1) installed, instead of new version (npm i html-to-text@8.0.0)

Tim Wijma
  • 1,526
  • 2
  • 9
  • 12