interviewstreet / firepad-x

Collaborative Text Editor Powered by Firebase
Other
37 stars 20 forks source link

Error while importing {fromMonaco} #34

Closed Shubham567 closed 3 years ago

Shubham567 commented 3 years ago

Error while importing {fromMonaco}

Description:

Got an error, while importing following line into a CRA app.


import {fromMonaco} from "@hackerrank/firepad";

Error:

./node_modules/@hackerrank/firepad/es/firebase-adapter.js
Module not found: Can't resolve 'firebase/app' in 'C:\Users\shubh\Documents\Experiments\react\cra-experiments\node_modules\@hackerrank\firepad\es'

Other Details:

I have installed "@hackerrank/firepad": "^0.1.1", as dependency through yarn.

What am I missing here?

Thanks in advance.

Adding package.json


{
  "name": "cra-mui-redux-template",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@hackerrank/firepad": "^0.1.1",
    "@material-ui/core": "^4.12.1",
    "@material-ui/icons": "^4.11.2",
    "@monaco-editor/react": "^4.2.1",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "clsx": "^1.1.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-redux": "^7.2.4",
    "react-router": "^5.2.0",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.3",
    "redux": "^4.1.0",
    "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"
    ]
  }
}
0xTheProDev commented 3 years ago

Hey @Shubham567, thanks for using this library. It uses Firebase as source of truth among all peers, so you either need to install firebase@7.12.0 (Ref: https://github.com/interviewstreet/firepad-x/blob/master/package.json#L57) or you can use your own Database Adapter with the default Firepad import.

Let me know if you face any further issue.

Shubham567 commented 3 years ago

Thanks @Progyan1997,

Apart from few "How to's" in mind, this library is working great.

0xTheProDev commented 3 years ago

Feel free to add to documentation if you like. 😄