Error 404
Error 404

Reputation: 11

I keep getting the following error: "Error: Cannot find module './framer'"

I keep encountering the same problem. I'm making a website for a barbershop and I am trying to use google api to add events into a google calendar. I installed googleapis and framer, but it keeps saying that it can't find the framer module. I even uninstalled framer and reinstalled it, and it is still not working.I get the error when I use the following code:

const {google} = require('googleapis');

Error message:

Uncaught Error: Cannot find module './framer'
    at webpackEmptyContext (protocol sync:2)
    at Array.map (<anonymous>)
    at Object../node_modules/http2/lib/protocol/index.js (index.js:46)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object.<anonymous> (http.js:136)
    at Object../node_modules/http2/lib/http.js (http.js:1262)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object../node_modules/http2/lib/index.js (index.js:18)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object.<anonymous> (http2.js:16)
    at Object../node_modules/googleapis-common/build/src/http2.js (http2.js:249)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object.<anonymous> (apirequest.js:23)
    at Object../node_modules/googleapis-common/build/src/apirequest.js (apirequest.js:304)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object../node_modules/googleapis-common/build/src/index.js (index.js:24)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object../node_modules/googleapis/build/src/apis/abusiveexperiencereport/index.js (index.js:17)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object../node_modules/googleapis/build/src/apis/index.js (index.js:17)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object../node_modules/googleapis/build/src/googleapis.js (googleapis.js:16)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Object../node_modules/googleapis/build/src/index.js (index.js:17)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Module.<anonymous> (timePicker.js:3)
    at Module../src/components/calendar/timePicker.js (timePicker.js:158)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Module.<anonymous> (Navbar.js:68)
    at Module../src/components/Appointment.js (Appointment.js:120)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Module.<anonymous> (protocol sync:9)
    at Module../src/App.js (App.js:42)
    at __webpack_require__ (bootstrap:856)
    at fn (bootstrap:150)
    at Module.<anonymous> (index.css?bb0a:82)
    at Module../src/index.js (index.js:18)
    at __webpack_require__ (bootstrap:856)

Upvotes: 1

Views: 1678

Answers (1)

Bro first of all to use googleapis you will need a separate backend this is because the framer library uses the file system module which comes with nodejs but not available with react. After all, it is a front-end library. A workaround is to use the REST API

Upvotes: 5

Related Questions