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
wise-white
wise-white455d 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
genetic-orange
genetic-orange455d ago
After adding transpilePackages: ["casbin"] to next.config.js the warning message still shows up
No description
wise-white
wise-white455d 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