https://cerbos.dev logo
#help
Title
# help
t

Tom von heill

07/10/2023, 6:20 PM
Hey all, trying to run some tests and mock out cerbos calls in cypress (typescript) but am now getting this error? anyone know of a quick fix for this
Copy code
Error: Webpack Compilation Error
./node_modules/@cerbos/http/lib/index.js 177:56
Module parse failed: Unexpected token (177:56)
Seemed to be due to the preprocessor in cypress, had to change the preprocessor to vite in cypress.config.ts
Copy code
export default defineConfig({
  e2e: {
    setupNodeEvents(on) {
      on('file:preprocessor', vitePreprocessor())
    },...})
a

Alex Olivier (Cerbos)

07/10/2023, 7:17 PM
Glad it’s sorted. Good to know cypress needs modification for Vite. What’s your use case for Cerbos?
t

Tom von heill

07/10/2023, 7:43 PM
Managing visibility of components on the front end based around roles at the moment, also a blocking access to some apis on the back end. In the end for front end testing,i've gotten completely away from stubbing and am just intercepting the cerbos api calls
8 Views