lmcq / firebase-firestorm

Firebase Firestorm is an ORM for Firestore which can be used with Typescript.
MIT License
252 stars 19 forks source link

Circular dependency & Uncaught TypeError: Cannot read property 'default' of undefined in createCommonjsModule rollup function #29

Open jones1008 opened 3 years ago

jones1008 commented 3 years ago

So I started a new svelte project with sapper and typescript and added firestore and firebase-firestorm.

When running npm run dev I get many circular dependency warnings from rollup:

Circular dependency: node_modules\firebase-firestorm\lib\utils\FieldUtils.js -> node_modules\firebase-firestorm\lib\utils\index.js -> node_modules\firebase-firestorm\lib\utils
\FieldUtils.js
Circular dependency: node_modules\firebase-firestorm\lib\utils\index.js -> node_modules\firebase-firestorm\lib\utils\FirestoreSerializer.js -> node_modules\firebase-firestorm\
lib\fields\DocumentRef.js -> node_modules\firebase-firestorm\lib\utils\index.js
Circular dependency: node_modules\firebase-firestorm\lib\utils\index.js -> node_modules\firebase-firestorm\lib\utils\FirestoreSerializer.js -> node_modules\firebase-firestorm\
lib\fields\DocumentRef.js -> node_modules\firebase-firestorm\lib\Collection.js -> node_modules\firebase-firestorm\lib\utils\index.js
...

Nonetheless the application is served but when opening the application in the browser I get the following error in the console:

Uncaught TypeError: Cannot read property 'default' of undefined

grafik

I created a minimum repo to reproduce this issue: https://github.com/jones1008/firebase-firestorm-circular-dependency Has this maybe to do with which typescript options you transform firebase-firestorm from typescript to javascript? Or maybe how rollup bundles the code?