rival-black
rival-black2y ago

Default access-control-casbin with next.js give warning of critical dependency

After integrating casbin with refine next.js project, I follow through boiler template but with next.js warn - ./node_modules/casbin/lib/esm/index.js Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
No description
No description
No description
3 Replies
like-gold
like-gold2y ago
Hey @phumcentral, Can you try adding the casbin package to the transpilePackages array of the next.config.js file? If your project doesn't exist next.config.js, you can add like here: https://github.com/refinedev/refine/blob/next/examples/with-nextjs/next.config.js
rival-black
rival-blackOP2y ago
After adding transpilePackages: ["casbin"] to next.config.js the warning message still shows up
No description
like-gold
like-gold2y ago
Our casbin example may outdated. If you create a new example for us following the below link, we will be very grateful. 🙏 https://casbin.org/docs/frontend
Frontend Usage | Casbin
Casbin.js is a Casbin addon that facilites your access-control management in the frontend application

Did you find this page helpful?