When using a single file vue component, attempting to import googleapis
through require
results in the following error:
Uncaught TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf (<anonymous>)
at t.exports (index.js:75)
at Object.f447 (index.js:54)
at o (bootstrap:78)
at Object.d465 (jwtclient.js:26)
at o (bootstrap:78)
at Object.<anonymous> (googleauth.js:37)
at Object.0a40 (googleauth.js:640)
at o (bootstrap:78)
at Object.3ccc (index.js:18)
The import of googleapis
is done as follows:
const { google } = require('googleapis')
If imported like this:
import { google } from 'googleapis'
The same error will be triggered the first time the google
import is called.
Any assistance would be greatly appreciated :)