Hello and thanks for the amazing work,
I’m not sure if this belongs here or in the slice-machine-ui repository, but the issue began while I was following the tutorial to install Prismic in my Nuxt project. The root problem seems to be that slice-machine-ui also depends on cookie module through its dependency on express. I’m unsure of the best way to resolve this easily.
Versions
- nuxt: 3.15.0
- @nuxtjs/prismic: 3.3.0
- node: v20.6.1
"dependencies": {
"@nuxtjs/supabase": "1.4.5",
"nuxt": "^3.15.0",
"vue": "latest",
"vue-router": "latest"
},
"devDependencies": {
"@nuxtjs/prismic": "^3.3.0",
"@slicemachine/adapter-nuxt": "^0.3.61",
"slice-machine-ui": "^2.11.1"
}
Reproduction
Additional Details
When using @nuxtjs/supabase with @nuxtjs/prismic, the application throws a runtime error:
Uncaught SyntaxError: The requested module does not provide an export named 'parse'
This happens because @supabase/ssr depends on the cookie module, and imports { parse } from it. However, the cookie module is exported as CommonJS (CJS), which doesn’t have named exports, leading to this issue in Nuxt's ESM environment.
Steps to Reproduce
- Clone the provided StackBlitz example.
- Install dependencies (
npm install or pnpm install).
- Run the project (
npm run dev or pnpm dev).
- Open the browser console and observe the error:
Uncaught SyntaxError: The requested module does not provide an export named 'parse'
What is Expected?
- The Nuxt app should successfully compile and render without import/export errors.
What is Actually Happening?
- The app throw a warning at runtime. It throws a syntax error about a missing named export
parse from the cookie module.
Workaround
- Override the
cookie version in package.json cause multiple versions are causing conflicts:
"resolutions": {
"cookie": "0.7.2"
}
This workaround should resolve the issue.
Hello and thanks for the amazing work,
I’m not sure if this belongs here or in the
slice-machine-uirepository, but the issue began while I was following the tutorial to install Prismic in my Nuxt project. The root problem seems to be thatslice-machine-uialso depends oncookiemodule through its dependency onexpress. I’m unsure of the best way to resolve this easily.Versions
Reproduction
.env.defaultto.envAdditional Details
When using
@nuxtjs/supabasewith@nuxtjs/prismic, the application throws a runtime error:This happens because
@supabase/ssrdepends on thecookiemodule, and imports{ parse }from it. However, thecookiemodule is exported as CommonJS (CJS), which doesn’t have named exports, leading to this issue in Nuxt's ESM environment.Steps to Reproduce
npm installorpnpm install).npm run devorpnpm dev).What is Expected?
What is Actually Happening?
parsefrom thecookiemodule.Workaround
cookieversion inpackage.jsoncause multiple versions are causing conflicts:This workaround should resolve the issue.