I try to get remote config from Firebase in the background of my extension.
I installed googleapis module with npm and i used webpack to compile and bundle files. When i try to import googleapis in my js file :
import {google} from 'googleapis';
and to use it : const jwtClient = new google.auth.JWT(...);
I have several errors displayed in the console :
ERROR in ./~/googleapis/build/src/googleapis.js
Module parse failed: /node_modules/googleapis/build/src/googleapis.js Unexpected token (81:10)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (81:10)
ERROR in ./~/googleapis-common/build/src/authplus.js
Module parse failed: /node_modules/googleapis-common/build/src/authplus.js Unexpected token (32:10)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (32:10)
I tried to use external function in webpack config to exclude googleapis from bundle compilation, without success
externals: {
googleapis: 'googleapis'
},
from googleapis npm module and webpack bundle error
No comments:
Post a Comment