Open dyerrington opened 1 year ago
+1
Same error. Any ideas on fix? Thanks.
Same problem here, can't figure out what is wrong.
Same error - I've tried multiple versions of the rootRef value, the documentation isn't clear what the value should be. I've also wiped all my rules to a blanket read/write allow and it still fails.
In my app, the data is segregated at the top by "clubs" ie clubs/{clubId}/members
and clubs/{clubid}/orders
In my firestore rules, a club admin is given general read/write permissions for things below /clubs. For testing purposes i'm hard-coding the clubId to my test club, in practice it will be selected by the admins based on which clubs they are admin for.
my config:
const dataProvider = FirebaseDataProvider(firebaseConfig, {
logging: true,
rootRef: "/clubs/test-club",
app: firebaseApp,
persistence: "local",
// disableMeta: true
dontAddIdFieldToDoc: true,
lazyLoading: {
enabled: true,
},
firestoreCostsLogger: {
enabled: true,
},
});
example resource:
<Resource name="orders" icon={PointOfSaleIcon} {...OrdersAdmin} />
The permissions aren't a problem on the customer facing app, so I know I can read and write to the appropriate stores.
In my earlier iteration, I had all the "club data" on the top level and it worked fine.
i have been investigating this for the past 2 days.
it look like the function getAbsolutePath in pathHelper.ts returning undefined
this is pretty much impossible since the code is quite simple, then I figured out that the bundling has something messed up.
i fixed it by going in node_modules/react-admin-firebase/package.json
change the main attribute from
"main": "dist/index.js"
to "main": "dist/src/index.js"
it just worked fine with, i tested it with rootRef and without rootRef and seems to work just fine.
this is extremely hacky but seems to work for now at least
i have been investigating this for the past 2 days. it look like the function getAbsolutePath in pathHelper.ts returning undefined this is pretty much impossible since the code is quite simple, then I figured out that the bundling has something messed up. i fixed it by going in node_modules/react-admin-firebase/package.json change the main attribute from
"main": "dist/index.js"
to"main": "dist/src/index.js"
it just worked fine with, i tested it with rootRef and without rootRef and seems to work just fine.
this is extremely hacky but seems to work for now at least
Why not just import them from dist/src
import {
FirebaseAuthProvider,
FirebaseDataProvider,
} from 'react-admin-firebase/dist/src';
Here's my basic setup:
I have no problem accessing resources with Firebase library directly:
Also seems to let me on just fine with the test user / pass I setup in Firebase so seems at least the API creds are ok. Since this is my first time using this library, I'm sure it's something really dumb that I'm overlooking? Whenver I add the
<Resource />
into<Admin />
, I get this error:Thanks in advance for any help!