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

Most upvoted comments

This works fine for latest supbase client 1.5.0

"@nuxtjs/supabase": "^1.5.0",
"resolutions": {
	"cookie": "0.7.2"
}

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:

Workaround

  1. Override the cookie version in package.json cause multiple versions are causing conflicts:
"resolutions": {
  "cookie": "0.7.2"
}

This workaround should resolve the issue.

@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.

This works fine for latest supbase client 1.5.0

"@nuxtjs/supabase": "^1.5.0",
"resolutions": {
	"cookie": "0.7.2"
}

delete the package-lock.json, node_modules, .nuxt, will work

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.2 in my deno.lock and cleaning node_modules was my workaround

    "@supabase/ssr@0.5.2_@supabase+supabase-js@2.49.1": {
      "integrity": "sha512-n3plRhr2Bs8Xun1o4S3k1CDv17iH5QY9YcoEvXX3bxV1/5XSasA0mNXYycFmADIdtdE6BG9MRjP5CGIs8qxC8A==",
      "dependencies": [
        "@supabase/supabase-js",
        "@types/cookie",
        "cookie@1.0.2"
      ]
    },

possibly 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?

The workaround works.

It did not for me. I ran rm -rf .nuxt .output node_modules pnpm-lock.yaml && pnpm i and still got the same error on 0.7.2

Just battled a while with this… even with the workaround above, it didn’t work…

Eventually I got around to removing dependencies and as soon as I removed socket.io I stopped getting the error… maybe this will help someone else.

The 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.

I believe you’ll want to open an issue on their repo, as that library is not part of Supabase. https://github.com/nuxt-modules/supabase/issues

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=1eda2991 which is this library, right?