-
-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using with react (vite) #386
Comments
@meodemsao did you try: https://github.com/casbin-js/react-authz ? |
@meodemsao you can try ReactAuthz, Casbin-core, Casbin.js, node-casbin is not really for frontend javascript |
This looks like a dependency issue, @Shivansh-yadav13 Could you work on this? |
Ohk, I'll look into it. |
i don't know how to use this, don't have any doc |
i will try https://github.com/casbin/casbin-core node-casbin work if i use with webpack, i have issue with vite |
@nodece @meodemsao I feel the code is running in browser, that's why we are getting this error, do you think there could be a bug or dependency error? |
Looks like a dependency error, could you testing the the https://vitejs.dev/guide/ ? |
@Shivansh-yadav13 @nodece i used casbin-core and work well |
Because I use the minimatch instead of the picomatch. |
thanks u |
@nodece should we do that in node-casbin also? |
@Shivansh-yadav13 I think we should use the minimatch instead of the picomatch, but some expressions cannot run on the minimatch, I checked the expressions, and I can accept that these expressions don't work. |
This does not work with Vue + Vite as well. I am getting the same error when I tried using vue-authz, or casbin.js. The issue is due to polyfills for Node not being available in the main casbin npm package (node-casbin). Since casbin.js and the wrappers like react-authz, vue-authz are browser targeting libraries, we would require node polyfills to be available for the libraries to work. |
@ItsKDaniel casbin.js and the wrappers like react-authz are for browser only. It's not for Node.js . If you have other questions, please create new issue. Closed here. |
I have problem when using node-casbin with react
The text was updated successfully, but these errors were encountered: