Next.js Discord

Discord Forum

punycode deprecated when using docker

Answered
Philippine Crocodile posted this in #help-forum
Open in Discord
Avatar
Philippine CrocodileOP
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 Philippine Crocodile
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
Philippine CrocodileOP
With pnpm run dev
Image
With Docker
Image
Avatar
Philippine CrocodileOP
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
joulev
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
Philippine CrocodileOP
I don't use punycode, that was the default Next.js project's code with node v21