Pratham Sikka
04/23/2024, 10:56 AMUncaught TypeError: Failed to resolve module specifier "@cerbos/http". Relative references must start with either "/", "./", or "../".
On troubleshooting I got to know that it can be an issue with how the module is imported in the client-side, and npm packages sometimes throw errors when used directly in browsers. I downloaded a build tool: Webpack, built it and now in the browser console, I get
cerbos-client.js:5 Uncaught Error: Cannot find module '@cerbos/http'
at webpackMissingModule (cerbos-client.js:5:50)
at eval (cerbos-client.js:5:137)
at ./cerbos-client.js (bundle.js:19:1)
at __webpack_require__ (bundle.js:53:41)
at eval (index.js:2:75)
at ./index.js (bundle.js:29:1)
at __webpack_require__ (bundle.js:53:41)
at bundle.js:93:37
at bundle.js:95:12
webpackMissingModule @ cerbos-client.js:5
eval @ cerbos-client.js:5
./cerbos-client.js @ bundle.js:19
__webpack_require__ @ bundle.js:53
eval @ index.js:2
./index.js @ bundle.js:29
__webpack_require__ @ bundle.js:53
(anonymous) @ bundle.js:93
(anonymous) @ bundle.js:95
index.html:1 Uncaught TypeError: Failed to resolve module specifier "@cerbos/http". Relative references must start with either "/", "./", or "../".
I would like to understand how to connect Cerbos using cerbos/http package and can grpc also be used, because in the repository linked above, it is written that for browser-based applications, cerbos/http provides a client for interacting with Cerbos PDPAndrew Haines (Cerbos)
exports
field in @cerbos/http's package.json
correctly. Could I check what versions of Node.js, Webpack, and @cerbos/http you're using?Andrew Haines (Cerbos)
Pratham Sikka
04/23/2024, 3:44 PM