Skip to content

[Bug] "does not provide an export named 'parse'" with cookie@1.0.2 in Nuxt 4 #137

Open

Description

@FlorianJoseph

Describe the bug

Hello Supabase team 👋

I am using @nuxtjs/supabase@2.0.1 with Nuxt 4.2 and cookie@1.0.2.
When running the project, I get the following error:

Uncaught (in promise) SyntaxError: The requested module 'cookie' does not provide an export named 'parse'

It seems related to the CommonJS → ESM import in @supabase/ssr@0.7.0.

Is there a plan to fix this or a recommended workaround until a patch release?

Thanks a lot!

Screenshots

Image

Activity

  1. added
    bug
    on Oct 31, 2025
  2. nilesh-ProdE commented on Oct 31, 2025

    @nilesh-ProdE

    Some more context after exploring further -

    likely cause - an ESM/CJS interop mismatch when importing cookie (named parse) during SSR with Nuxt/Vite + pnpm. At runtime the resolved module shape doesn’t expose parse as a named export.

    workarounds:

    1. pin cookie to a CJS version:

      cookie@0.5.0
      

      Reinstall and re-run.

    2. if patching locally, switch to an interop‑safe import:

      import * as cookie from 'cookie'
      const { parse, serialize } = cookie
      // or:
      import cookiePkg from 'cookie'
      const { parse, serialize } = cookiePkg

    suggestion - update @supabase/ssr to use an interop‑safe cookie import or align the SSR build so it works consistently across cookie 0.5.x/1.x and common bundlers.

  3. FlorianJoseph commented on Nov 1, 2025

    @FlorianJoseph
    Author

    Aucune des 2 solutions ne résoute le problème

  4. transferred this issue fromsupabase/supabaseon Nov 1, 2025
  5. Hallidayo commented on Nov 1, 2025

    @Hallidayo

    Transferred from supabase repo.

  6. popadicbranislav commented on Nov 2, 2025

    @popadicbranislav

    Is this duplicate of the #62 ?

  7. FlorianJoseph commented on Nov 2, 2025

    @FlorianJoseph
    Author

    Thanks @popadicbranislav for your help, i'll try to downgrade Nuxt 4.2.0 for Nuxt 4.1.3 and reply later

  8. FlorianJoseph commented on Nov 2, 2025

    @FlorianJoseph
    Author

    @popadicbranislav thank you so much, my project works again if i downgrade Nuxt 4.2.0 -> 4.1.3

  9. gergely-xyz commented on Jan 28, 2026

    @gergely-xyz

    The issue is still present with Nuxt 4.3.0. What worked for me as a workaround is aliasing 'cookie' to 'cookie-es'.

    npm i cookie-es

    And in your nuxt.config.ts add the aliases like so:

    export default defineNuxtConfig({
      alias: {
        cookie: 'cookie-es',
      },
      nitro: {
        alias: {
          cookie: 'cookie-es',
        },
      },
    })
  10. Psycarlo commented on Feb 19, 2026

    @Psycarlo

    Facing same issue. I'm using:

    bun
    nuxt ^4.3.1
    @nuxtjs/supabase ^2.0.3

    #137 (comment) worked for me

  11. github-actions commented on Sep 4, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale because it has not had any activity for 6 months.
    It will be closed in 30 days if no further activity occurs.

    If this is still relevant, please comment to keep it open.

  12. added
    has workaround
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughas workaround

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions