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

Deprecation warning of "punycode" module in freshly created next js app in Windows 11 #75313

Closed
vickvey opened this issue Jan 25, 2025 · 2 comments · Fixed by #75741
Closed
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application. linear: next Confirmed issue that is tracked by the Next.js team. locked

Comments

@vickvey
Copy link

vickvey commented Jan 25, 2025

Link to the code that reproduces this issue

https://github.com/vickvey/next-imdb/

To Reproduce

  1. Create a fresh next app with npm create-next-app@latest in windows 11 from powershell terminal.
  2. Run the developement server using npm run dev.
  3. You will see the warning there about some punycode module is expired.

PS: I dont't know but I think its just dont feels right that, although I have just created a new fresh next app using "npx create-next-app@latest" and nothing else but yet I get this punycode deprecation warning, this means that the create-next-app@latest has some flaws which needs to fixed maybe there is need to update the dependecies.

Current vs. Expected behavior

Image

See here the punycode deprecation warning in freshly created next app using npm create-next-app@latest.
Please resolve this issue, as I have OCD of using deprecated software.

Provide environment information

Operating system:
Windows 11
Architecture:
x64

Which area(s) are affected? (Select all that apply)

create-next-app

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

Nothing, Please fix this. The biggest reason for me creating this issue is I mean i just used the latest version of next-js to create a fresh next app but still got a deprecation warning of some punycode module. Please resolve this.

@github-actions github-actions bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jan 25, 2025
@wowczarczyk
Copy link

It is because the pre-compiled node-fetch still uses the native "punycode" library:

I created a PR for that:
#75394

@samcx samcx added the linear: next Confirmed issue that is tracked by the Next.js team. label Jan 28, 2025
ijjk added a commit that referenced this issue Feb 19, 2025
## What

This PR replaces the usage of node-fetch in the next/font/google loader
code, which runs as part of every next build. `node-fetch` relies on
`punycode`, which shows a deprecration warning from Node.js 22,
affecting every users on Next.js and Node 22.

This PR also removes any other references to the vendored node-fetch
used in other parts of the codebase.

~~Unfortunately, we can't remove it because other next.js dependencies
like the amp optimiser actually use node-fetch, so they would need to be
updated separately.~~

not a problem anymore because of @wowczarczyk suggestion of also
rewriting the external in the dependencies to point to the correct one

This PR does not remove the node-fetch usage in tests.

## How

This replaces the node-fetch call with a call to the native fetch
exposed in Node.js. However, this fetch does not support proxies without
tapping into Undici, so I've had to "polyfill" a usage because I did not
want to add a dependency to Undici for a minor use case.

<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- Read the Docs Contribution Guide to ensure your contribution follows
the docs guidelines:
https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc
https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See
https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-


-->
Fixes #66289
Fixes #75313
Closes NDX-730

---------

Co-authored-by: JJ Kasper <[email protected]>
Copy link
Contributor

github-actions bot commented Mar 6, 2025

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Mar 6, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application. linear: next Confirmed issue that is tracked by the Next.js team. locked
Projects
None yet
3 participants