ssr: cookie/index.js does not provide an export named 'parse' helpers.js
Bug report
- [ X] I confirm this is a bug with Supabase, not with my own application.
- [ X] I confirm I have searched the Docs, GitHub Discussions, and Discord.
Describe the bug
Getting Uncaught SyntaxError: The requested module '/_nuxt/node_modules/.pnpm/cookie@0.6.0/node_modules/cookie/index.js?v=1eda2991' does not provide an export named 'parse' (at helpers.js?v=1eda2991:1:10) in my Nuxt application.
File location where error is thrown: http://localhost:3000/_nuxt/node_modules/.pnpm/@supabase+ssr@0.5.1_@supabase+supabase-js@2.45.3/node_modules/@supabase/ssr/dist/module/utils/helpers.js?v=1eda2991
A clear and concise description of what the bug is. See error message.
I had this issue before and I think I fixed it by manually editing the node_modules and change this line:
import {parse as cookieParse, serialize as cookieSerialize} from "/_nuxt/node_modules/.pnpm/cookie@0.6.0/node_modules/cookie/index.js?v=1eda2991"; to this
const { parse: cookieParse, serialize: cookieSerialize } = require("cookie");
Since then I have forgot about it. Now it’s happening again because it was just a temp local fix.
I wanted to retry if editing the helpers.js in the node_modules would fix it again but now for some reason my changes in the node modules are not being applied. I have spent countless hours into figuring out why.
So unfortunately as of now this is all the information I can give you about this bug. Maybe someone else experiences the same issue.
I’m using the @nuxtjs/supabase module.
System information
- OS: macOS
- Browser (if applies) Google Chrome
- Version of supabase-js: 2.39.0
- Version of Node.js: v22.2.0 -Version of @nuxtjs/supabase: 1.1.6
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 26 (3 by maintainers)
Commits related to this issue
- fix(supabase): patch cookie module version Per https://github.com/supabase/ssr/issues/62 — committed to CodeForPhilly/codeforphilly-ng by themightychris 2 years ago
- fix(deps): use npm override to pin cookie version Per https://github.com/supabase/ssr/issues/62 — committed to CodeForPhilly/codeforphilly-ng by themightychris 2 years ago
This works fine for latest supbase client 1.5.0
delete the package-lock.json, node_modules, .nuxt, will work
I think this only affects Nuxt yes, not really sure as to why, but maybe we can work on a fix at the Nuxt module level in the meantime.
Just sharing a workaround here in the meantime while waiting for v6:
@j4w8n Yes, for sure only affecting the nuxt3 users, Because under the hood it’s using cookie.js which is not compatible
To my knowledge, no one is working on this; but comms can be inconsistent and they are working on it but just don’t mention it.
Is it safe to say that this only affects Nuxt users?
@Dino-Kupinic @abeldotam @herifanantenana @gregorylocigno @piyushdolar @sanyukta-09 @guillaumeboussion @BinaryShrub @fanckush @L422Y @MachariaK @lihbr @phillipmohr
“overrides”: { “cookie”: “1.0.2” }
Adding this in package.json worked for me.
Thanks mate, can confirm it worked like a charm.
If ever some of you encounter this problem, you might also encounter issues with devtools, that will not work due to this issue. Because of this, I spent 2 entire days trying to get what’s wrong
Thanks @lihbr for the workaround
forcing an update to
1.0.2in my deno.lock and cleaning node_modules was my workaroundpossibly related to this change? https://github.com/supabase/ssr/commit/95245282e67ce649b58504e3a98200797b7cd8f1
I noticed they upgraded cookie and removed parse from one of the files but not helper?
It did not for me. I ran
rm -rf .nuxt .output node_modules pnpm-lock.yaml && pnpm iand still got the same error on 0.7.2The workaround works. After adding it, you have to delete the node_modules directory and lock files (package-lock.json or yarn.lock), then reinstall your dependencies.
Sorry I forgot to mention that the error occurs in
http://localhost:3000/_nuxt/node_modules/.pnpm/@supabase+ssr@0.5.1_@supabase+supabase-js@2.45.3/node_modules/@supabase/ssr/dist/module/utils/helpers.js?v=1eda2991which is this library, right?