question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependency on deprecated Node "punycode" module

See original GitHub issue

The project calls require('punycode'), using the Node punycode module which has been deprecated since v7 (2016). The Node docs now recommend using punycode.js in place of it.

This also means that when this library is used in a project using webpack, webpack must be manually configured to load punycode.js as a replacement for the punycode module because webpack since v5 (2020) no longer defaults to including shims for Node APIs like punycode.

It would be helpful if this library switched to using punycode.js instead of the Node punycode module.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Macilcommented, Jun 16, 2022

I believe that part of the readme about browser support is just referring to that they started using ES2015isms like const and discontinued their UMD build which could work in pre-ES2015 browsers without a bundler. We’re using Punycode.js in browsers fine through Webpack right now, and Punycode.js’s ESM build even works directly as-is in browsers. (I think Punycode.js’s readme is misleadingly worded and I’ve sent a PR to fix that: https://github.com/mathiasbynens/punycode.js/pull/118.)

This library psl is already in CommonJS format and requires a bundler to be used within a browser, so adding a dependency on Punycode.js v2 would not cause a regression for people targeting (ES2015-supporting non-ancient) browsers specifically. But it would cause an issue for people not transpiling their code like with Babel and targeting ancient runtimes that don’t support ES6 features like const such as Rhino. It might be good for psl to do a major version update if it adds a dependency on Punycode.js v2 then.

1reaction
lupomonterocommented, Jul 5, 2022

Nice one @wegry 💪

Read more comments on GitHub >

github_iconTop Results From Across the Web

Punycode | Node.js v19.3.0 Documentation
The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be...
Read more >
DeprecationWarning: The punycode module is deprecated #29
I see two workarounds: Forking node-fetch . That might cause compatibility problems if both sync-fetch and non-forked node-fetch are used and ...
Read more >
punycode is deprecated in npm - what should I replace it with?
The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be...
Read more >
punycode - npm
A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.
Read more >
punycode
The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found