Skip to content

Commit ba806e7

Browse files
committed
Add try-catch block for firebase-app error
1 parent 657ef61 commit ba806e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/firebase/rollup.config.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ const componentsConfig = components.map(component => ({
7373
name: GLOBAL_NAME,
7474
globals: {
7575
'@firebase/app': GLOBAL_NAME
76-
}
76+
},
77+
intro: `try {`,
78+
outro: `} catch(err) {
79+
console.error(err);
80+
throw new Error(
81+
'Cannot instantiate firebase-${component} - ' +
82+
'be sure to load firebase-app.js first.'
83+
);
84+
}`
7785
},
7886
plugins,
7987
external: ['@firebase/app']

0 commit comments

Comments
 (0)