Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. #9521

Closed
7 tasks done
pasqualesimonetti opened this issue Dec 3, 2023 · 4 comments

Comments

@pasqualesimonetti
Copy link

pasqualesimonetti commented Dec 3, 2023

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have read and followed the Issue Tracker Guide
  • I have searched and referenced existing issues and discussions
  • I am filing a BUG report.
  • I have managed to reproduce the bug after upgrading to the latest version
  • I have created an accurate and minimal reproduction

Version

5.3.0

In What environments are you experiencing the problem?

Node.js

Node Version (if applicable)

21.0.0

Link To Reproduction

https://codesandbox.io/p/devbox/fabric-node-sandbox-forked-x8g3lv?file=%2F.codesandbox%2FDockerfile%3A1%2C13&layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clppcy3s300063b6i78v0y240%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clppcy3s300033b6iznuxl2i1%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clppcy3s300043b6iwf3ayma7%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clppcy3s300053b6iqm82fffo%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B60%252C40%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clppcy3s300033b6iznuxl2i1%2522%253A%257B%2522id%2522%253A%2522clppcy3s300033b6iznuxl2i1%2522%252C%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clppd1nte003k3b6iz4zp9gw5%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522initialSelections%2522%253A%255B%257B%2522startLineNumber%2522%253A1%252C%2522startColumn%2522%253A13%252C%2522endLineNumber%2522%253A1%252C%2522endColumn%2522%253A13%257D%255D%252C%2522filepath%2522%253A%2522%252F.codesandbox%252FDockerfile%2522%252C%2522state%2522%253A%2522IDLE%2522%257D%255D%252C%2522activeTabId%2522%253A%2522clppd1nte003k3b6iz4zp9gw5%2522%257D%252C%2522clppcy3s300053b6iqm82fffo%2522%253A%257B%2522id%2522%253A%2522clppcy3s300053b6iqm82fffo%2522%252C%2522activeTabId%2522%253A%2522clppd3lbn00a23b6igg0vofbt%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A8080%252C%2522id%2522%253A%2522clppd1xk3007b3b6icvp8fl0b%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522path%2522%253A%2522%252F%2522%257D%252C%257B%2522type%2522%253A%2522PROJECT_SETUP%2522%252C%2522id%2522%253A%2522clppd3lbn00a23b6igg0vofbt%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%255D%257D%252C%2522clppcy3s300043b6iwf3ayma7%2522%253A%257B%2522id%2522%253A%2522clppcy3s300043b6iwf3ayma7%2522%252C%2522activeTabId%2522%253A%2522clppd1pw4005i3b6isu54b2c0%2522%252C%2522tabs%2522%253A%255B%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522id%2522%253A%2522clppd1pw4005i3b6isu54b2c0%2522%252C%2522mode%2522%253A%2522permanent%2522%257D%255D%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

Steps To Reproduce

  1. Install Node.js 21.x
    $ nvm install stable (currently v21.3.0)

  2. Install the latest version of Fabric.js (currently v5.3.0 or v6.0.0 beta10)

$ npm install fabric --save
// or
$ yarn add fabric
$ npm install fabric@beta --save
// or
$ yarn add fabric@beta
  1. Install dependencies
    $ npm install

  2. Run

$ node --trace-deprecation -r ts-node/register **your file**.ts
// or
$ ts-node **your file**.ts

The issue can be also reproduced on CodeSandBox by editing the .codesandbox/Dockerfile file with FROM node:21 and restarting.

A Fabric.js dependency use psl which produce the DeprecationWarning as illustated here: https://nodejs.org/api/punycode.html

$ npm ls psl
_**your code**_
└─┬ fabric@5.3.0
  └─┬ jsdom@19.0.0
    └─┬ tough-cookie@4.1.3
      └── psl@1.9.0

In the meantime this can be fixed with:

$ npm install punycode --save

// and then in /node_modules/psl/index.js

// replace this:
var Punycode = require('punycode');
// with this:
var Punycode = require('punycode/');

basically just add a trailing forward slash

Expected Behavior

No Deprecation Warning.

Actual Behavior

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

Error Message & Stack Trace

No response

@ShaMan123
Copy link
Contributor

Fabric can't be used on node21 until node canvas resolves an issue with their prebuilds
There is a tracking issue somewherr overthere

@asturur
Copy link
Member

asturur commented Dec 11, 2023

I think node-canvas 3.0 could solve that? is mentioned in the changelog but not released.

@ShaMan123
Copy link
Contributor

There is a tracking issue somewherr overthere

Automattic/node-canvas#2295

@ShaMan123
Copy link
Contributor

There is a tracking issue somewherr overthere

Automattic/node-canvas#2295

The rebuilds are published, node 21 can be used, closing

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

No branches or pull requests

3 participants