Skip to content

DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. #914

@mathiasfoster

Description

@mathiasfoster

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

When using Supabase-JS, I get an error about the punycode module being deprecated.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. npm install @supabase/supabase-js
  2. node .
  3. Error: DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
  4. npm ls whatwg-url
  5. Response: @supabase/supabase-js@2.38.4
    │ └─┬ @supabase/node-fetch@2.6.14
    │ └── whatwg-url@5.0.0

Expected behavior

No deprecation.

System information

  • OS: WSL2 on Windows 10
  • Version of supabase-js: ^2.38.4
  • Version of Node.js: v21.1.0

Activity

bhvngt

bhvngt commented on Nov 19, 2023

@bhvngt

I got similar error when I upgraded my node version to v21. This is due to older version of whatswg-url used inside @supabase/node-fetch.

One quick workaround till the team upgrades this dependency is to override the version in your package.json. Since I use pnpm as a package manager. I am using following snippet inside my package.json

	"pnpm": {
		"overrides": {
			"whatwg-url": "13.0.0"
		}
	}
rossirpaulo

rossirpaulo commented on Dec 20, 2023

@rossirpaulo

any updates here?

jk-sulis

jk-sulis commented on May 10, 2024

@jk-sulis

I would also appreciate an upgrade :)

AdamBD

AdamBD commented on Jun 24, 2024

@AdamBD

Any schedule for this? Its an annoying warning in the main javascript SDK.

m-shaka

m-shaka commented on Jun 27, 2024

@m-shaka

I guess there are two ways to fix this:

  • release new @supabase/node-fetch based on node-fetch v3, which doesn't depend on whatwg-url, and use it from this library
  • use native fetch instead of @supabase/node-fetch

In my opinion, the second is better since Node.js v18, the oldest maintained LTS, is supporting fetch.
However, that means the library will stop supporting dead versions of Node.js.
supabase is a business so it may be difficult to do that.

Anyway, I can contribute so please let me know, maintainers

obra

obra commented on Sep 5, 2024

@obra

Hi supabase folks - Is there anything that users/customers can do to push this forward? Having a deprecation warning logged in our apps (and even in the happy path of the tutorials) because they're using supabase's first party js libraries feels a little bit like a broken window.

expertzz

expertzz commented on Sep 20, 2024

@expertzz

I got similar error when I upgraded my node version to v21. This is due to older version of whatswg-url used inside @supabase/node-fetch.

One quick workaround till the team upgrades this dependency is to override the version in your package.json. Since I use pnpm as a package manager. I am using following snippet inside my package.json

	"pnpm": {
		"overrides": {
			"whatwg-url": "13.0.0"
		}
	}

A year later this is still the only fix

kevinwright

kevinwright commented on Oct 29, 2024

@kevinwright

Why does this continue to be an issue after all this time when it's so trivially fixed by upgrading the whatwg-url dependency or just using native fetch?

AlbinoGeek

AlbinoGeek commented on Jan 6, 2025

@AlbinoGeek

Would be nice if Supabase would handle this upgrade...

Unless you specifically run your project on the old ass "Maintenance" version (20) you are still plagued with this, making every build log unreadable in larger projects.

image

  • NodeJS LTS is 22, which shows this warning.
  • NodeJS Current is 23, which shows this warning.
  • NodeJS 24 is coming around the corner, and FAILS BUILDING (punycode removed.)
AlbinoGeek

AlbinoGeek commented on Jan 6, 2025

@AlbinoGeek

For those of us using anything other than pnpm the "solution" until Supabase gets on this is as follows:

package.json

You must place the version override in "resolutions" to enforce it is used across the project. "overrides" only works for direct dependencies, not those of your children's children.

  "resolutions": {
    "whatwg-url": "^13"
  },
added a commit that references this issue on Mar 5, 2025
swcho

swcho commented on Mar 15, 2025

@swcho

For npm, I tried next and at least warning message disappeared.
But I'm not sure it is practically working ok with @supabase/node-fetch.

  "overrides": {
    "@supabase/node-fetch": {
      "whatwg-url": "^13"
    }
  },
self-assigned this
on Jul 24, 2025
mandarini

mandarini commented on Jul 24, 2025

@mandarini
Contributor

Hi all! Thank you very much for chiming in and contributing to Supabase!

Once we officially drop support for Node 18, in October, then I will be merging this PR, or some version of it, removing the @supabase/node-fetch dependency and saving everyone from this warning.

I know that some of you may see a solution here, but that would require Node >= 18. As our new Support Policy, is, well, new, I don't want anyone using Node <18 (for whatever reason they may have to use such an old version) to run into any issues. This has indeed created some debt, but all debt will be resolved starting November 1st, I promise. Please bear with me.

That being said, you can use this workaround for now, until we officially get rid of node-fetch. I could add some code to suppress that warning, but I want to take the proper way forward. I hope this makes sense.

Again, thank you very much for your patience and for contributing to Supabase!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency fileplanned

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @obra@kevinwright@swcho@AdamBD@AlbinoGeek

    Issue actions

      DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. · Issue #914 · supabase/supabase-js