Closed cedricjacobs closed 1 year ago
it seems that the major issue here is indeed the fact that material ui has so many underlying changes.
They switched to the newer version of material-ui for React Admin 4. This is the cause of your errors.
If like me, you don't use auth and UI from supabase, you can copy paste the dataProvider in your project. https://github.com/marmelab/ra-supabase/blob/main/packages/ra-supabase-core/src/dataProvider.ts
And replace this import.
- import { DataProvider, GetListParams } from 'ra-core';
+ import { DataProvider, GetListParams } from "react-admin";
I don't think I needed to modify other stuff, but it was several weeks ago, so I'm not sure about that 😄
Are there plans to update this package to work with React Admin 4 or has it reached end of life? I'm about to start a new project and don't want to use something that will make updating the code base in future more of a pain than it needs to be.
For the data provider part, you can use ra-data-postgrest
. For the auth part, there is not much in the library, but it actually needs an update.
If anyone is willing to help with this, feel free to open a PR!
Ok thanks for the update, I don't have the knowledge in the 2 platforms yet to be of any use but I will look into the package code as a reference for what I need to do.
Note that for ra-data-postgrest
to works, you must specify the following endpoint:
YOUR_SUPABASE_INSTANCE_URL/rest/v1
Great, thanks for the heads up 😄
Is anyone working on a PR yet? We'll need it for a project and are happy to contribute. Let's chat :)
Nobody is working on a PR that I know of, so you're free to give it a spin!
Hi @fzaninotto I think I've run most of the update, however I have a hard time setting up the correct dependency loading in order to everything before creating a PR. The monorepo is giving me a hard time...
Would you (or anyone else, for that matter) maybe find the time to give it a quick rest run from this repo: https://github.com/arnespremberg/ra-supabase
Thanks @arnespremberg!
@fzaninotto it looks like ra-data-postgrest
isn't working either?:
https://github.com/raphiniert-com/ra-data-postgrest/issues/31
@braco I ended up forking and upgrading dependencies / implementing fixes for React Admin 4 myself - you can see the package details here
@promitheus7 Why not push it upstream?
What's the current status on this? Anyone willing to have a chat on how to move this forward?
@promitheus7, I would be very happy, if you could just push the changes upstream, instead of highjacking the project. Then I would create a new major version. That's how OS works generally.
Kind regards
@promitheus7 Why not push it upstream?
@RWOverdijk I opened an issue 2 months ago but did not hear back. Was not sure if the OG author was still maintaining the package. PR available in the comment above.
@promitheus7 My bad, I thought the changes were for this repo, I didn't notice it was ra-data-postgrest
ra-data-postgrest added RA 4.1.x compatibility #35 and it was released in 1.2.0. Now can we forward to something?
We released v2.0.0
. It supports react-admin v4
When installing this plugin with react-admin 4.0.1 the following errors occur in the console:
`ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/AuthLayout.js 26:0-49 Module not found: Error: Can't resolve '@material-ui/core' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/AuthLayout.js 27:0-67 Module not found: Error: Can't resolve '@material-ui/core/styles' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/AuthLayout.js 28:0-52 Module not found: Error: Can't resolve '@material-ui/styles' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/AuthLayout.js 29:0-47 Module not found: Error: Can't resolve '@material-ui/icons/Lock' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/Input.js 24:0-46 Module not found: Error: Can't resolve '@material-ui/core' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/LoginForm.js 3:0-47 Module not found: Error: Can't resolve 'react-final-form' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/LoginForm.js 4:0-74 Module not found: Error: Can't resolve '@material-ui/core' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/LoginForm.js 5:0-54 Module not found: Error: Can't resolve '@material-ui/core/styles' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/SetPasswordForm.js 39:0-47 Module not found: Error: Can't resolve 'react-final-form' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/SetPasswordForm.js 40:0-74 Module not found: Error: Can't resolve '@material-ui/core' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'
ERROR in ../../node_modules/ra-supabase-ui-materialui/esm/SetPasswordForm.js 41:0-54 Module not found: Error: Can't resolve '@material-ui/core/styles' in '/Users/cedricjacobs/Dev/camp-cooking/whats-cooking/node_modules/ra-supabase-ui-materialui/esm'`
I have used Nx to bootstrap the project with react 18