supabase-js icon indicating copy to clipboard operation
supabase-js copied to clipboard

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

Open mathiasfoster opened this issue 1 year ago • 7 comments

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/[email protected] │ └─┬ @supabase/[email protected] │ └── [email protected]

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

mathiasfoster avatar Nov 16 '23 03:11 mathiasfoster

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"
		}
	}

bhvngt avatar Nov 19 '23 10:11 bhvngt

any updates here?

rossirpaulo avatar Dec 20 '23 03:12 rossirpaulo

I would also appreciate an upgrade :)

jk-sulis avatar May 10 '24 09:05 jk-sulis

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

AdamBD avatar Jun 24 '24 19:06 AdamBD

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

m-shaka avatar Jun 27 '24 06:06 m-shaka

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.

obra avatar Sep 05 '24 17:09 obra

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

ExpertzZ avatar Sep 20 '24 09:09 ExpertzZ