Next.js Discord

Discord Forum

punycode deprecated when using docker

Answered
ViipeR posted this in #help-forum
Open in Discord
Avatar
Hello, it seems that my Next.js app's Docker container isn't set correctly because it says that punycode module is deprecated but when I launch it with pnpm run dev the module isn't deprecated. How can I do?

My Dockerfile

FROM node:latest

WORKDIR /app

RUN npm install -g pnpm

COPY pnpm-lock.yaml ./

COPY package.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD ["pnpm", "run", "dev"]
Answered by ViipeR
I found. I'm using nodejs v20.11.1 ans my Docker container is with nodejs v21.6.2 and punycode was depreciated betweed v20.11.1 and v21.6.2. I downgraded my Docker container's nodejs version to v20.11.1 and it works
View full answer

6 Replies

Avatar
With pnpm run dev
Image
With Docker
Image
Avatar
I found. I'm using nodejs v20.11.1 ans my Docker container is with nodejs v21.6.2 and punycode was depreciated betweed v20.11.1 and v21.6.2. I downgraded my Docker container's nodejs version to v20.11.1 and it works
Answer
Avatar
I found this warning to be harmless, I’m using node 21 and get bombarded with that warning every time and I just ignore, no need to worry about it
If you use the punycode module in your code, you should migrate but here it’s a library’s fault so there’s nothing you can do anyway (other than downgrading node) so just ignore the warning
Avatar
I don't use punycode, that was the default Next.js project's code with node v21