Replies: 33 comments 6 replies
-
also happens to me but only when building docker image, which is weird. i've tried alpine, debian and even archlinux as base images, same error my nextjs.config.js has nothing but rewrites in it using next 14.2.5 |
Beta Was this translation helpful? Give feedback.
-
honestly I have no idea what the exact issue is. seems to be related to zod and/or openai-node project repo: https://github.com/eyenalxai/paste steps to reproduce:
i will try to pinpoint the issue in the meantime |
Beta Was this translation helpful? Give feedback.
-
Can't be I've the same happen for this packages set:
Since you ain't using |
Beta Was this translation helpful? Give feedback.
-
The same thing happened to me on when building Next.js on docker in Github Actions for Cypress E2E tests. https://github.com/cypress-io/github-action?tab=readme-ov-file#docker-image ▲ Next.js 14.2.5 Creating an optimized production build ... static/chunks/516-dd8f1e03298072f7.js from Terser |
Beta Was this translation helpful? Give feedback.
-
The same thing happened when I built Nextjs on the @digitalocean app platform. static/chunks/f52d054b-e146e205a9860f66.js from Terser |
Beta Was this translation helpful? Give feedback.
-
I think I've found a consistent way to trigger the error. One of these lines triggers the error, other does not: To reproduce:
This will result in an error. Then, swap the comments on the lines as follows:
Run |
Beta Was this translation helpful? Give feedback.
-
I had the same issue. I used node-version: "20.10.0" which works for me. |
Beta Was this translation helpful? Give feedback.
-
FWIW, I had no issues with my builds using Node version 20.17.0 up until 2 days ago, on August 23rd. So, it seems to be a very new issue with how strings are being parsed by Terser. I tried downgrading to Node version 20.10.0 as suggested by @C3ntraX, but still no luck |
Beta Was this translation helpful? Give feedback.
-
I can confirm that the issue only happens when building my Next.js v14.2.6 app as a Docker image. I was able to isolate the file which causes the issue; however, I haven't made any significant changes since before this issue arose. I would share the file, but I think it is unnecessary, given my previous sentence. |
Beta Was this translation helpful? Give feedback.
-
Catching the same problem - Nextjs 13.2.4 / Docker / Github actions / Nodejs slim 16
Tried versions 20.14.0 and 20.10.0 - did not solve the problem. As a temporary solution I disabled swc in next.config.js. |
Beta Was this translation helpful? Give feedback.
-
Happening to me as well! Even locally on my mac..
|
Beta Was this translation helpful? Give feedback.
-
My Next.js build using GitHub Actions fails on an API route as well. |
Beta Was this translation helpful? Give feedback.
-
Downgrading node from |
Beta Was this translation helpful? Give feedback.
-
Here's what my build logs from GitHub Actions look like:
Note that this build succeeded on the latest version of Next.js and Node.js prior to August 23rd. |
Beta Was this translation helpful? Give feedback.
-
It builds successfully in local, but fails in ci/cd process like github actions.
I solved this issue temporarily thanks to comment I replied. However, the |
Beta Was this translation helpful? Give feedback.
-
Had this problem with |
Beta Was this translation helpful? Give feedback.
-
Getting the error across all my |
Beta Was this translation helpful? Give feedback.
-
I choice to revisit the use of https://snyk.io/blog/choosing-the-best-node-js-docker-image/ Maybe it will help some of you to choose the most appropriate Node Docker image too. The authors of the article suggested using |
Beta Was this translation helpful? Give feedback.
-
Solution for me was switching from 'node:bullseye' -> 'node:22.6-bullseye' in the docker image. node:bullseye started using 22.7.0 when it was available I guess and that made our pipeline explode |
Beta Was this translation helpful? Give feedback.
-
Changing the docker image to |
Beta Was this translation helpful? Give feedback.
-
Switching docker image from |
Beta Was this translation helpful? Give feedback.
-
As said, a migrate my based image from |
Beta Was this translation helpful? Give feedback.
-
This is likely a bug in node v22.6. I have filed an issue and node.js team is looking into it. |
Beta Was this translation helpful? Give feedback.
-
Can confirm that changing my node-version specification in my Github Action yml files from "22" to "22.6.0" has fixed this issue in my branch checks. Thanks @darthmaim! |
Beta Was this translation helpful? Give feedback.
-
i am having the same issue on vercel, vps and local machine |
Beta Was this translation helpful? Give feedback.
-
I had the same error on GitHub actions when building, I was able to resolve this by downgrading the node version in my yml from: |
Beta Was this translation helpful? Give feedback.
-
Yeah, for me the build is failing on |
Beta Was this translation helpful? Give feedback.
-
In my situation, I encountered issues due to strange Unicode characters. I used the following script to identify the unusual characters and then attempted to search, delete, or replace them, which resolved the problem: I executed this script with bun: const fs = require('fs');
const filePath = './YOURFILE.tsx'; // replace
const fileContent = fs.readFileSync(filePath, 'utf8');
function isCommonNonASCII(char) {
const commonNonASCII = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ';
return commonNonASCII.includes(char);
}
let unusualChars = new Map();
let lineNumber = 1;
fileContent.split('\n').forEach((line) => {
for (let i = 0; i < line.length; i++) {
const char = line[i];
const charCode = char.charCodeAt(0);
if (charCode > 255 && !isCommonNonASCII(char)) {
if (!unusualChars.has(char)) {
unusualChars.set(char, []);
}
unusualChars.get(char).push({ line: lineNumber, column: i + 1 });
}
}
lineNumber++;
});
console.log('Unusual characters found:');
unusualChars.forEach((positions, char) => {
console.log(`"${char}" (U+${char.charCodeAt(0).toString(16).padStart(4, '0')}):`);
positions.forEach(pos => console.log(` Line ${pos.line}, Column ${pos.column}`));
});
if (unusualChars.size === 0) {
console.log('No unusual characters found.');
} My package.json {
"name": "xxxxxxxxx",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbo",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@next/mdx": "^14.2.13",
"@svgdotjs/svg.js": "^3.2.4",
"@types/mdx": "^2.0.13",
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc",
"dom-serializer": "^2.0.0",
"encoding": "^0.1.13",
"next": "15.0.0-rc.0",
"next-mdx-remote": "^5.0.0",
"next-themes": "^0.2.1",
"openai": "^4.63.0",
"p-limit": "^4.0.0",
"raw-loader": "^4.0.2",
"react": "19.0.0-rc-e4953922-20240919",
"react-dom": "19.0.0-rc-e4953922-20240919",
"sass": "^1.79.3",
"server-only": "^0.0.1",
"sonner": "^1.5.0",
"styled-components": "^5.3.11",
"suncalc": "^1.9.0",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"terser": "^5.33.0",
"unified": "^9.2.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@types/styled-components": "^5.1.34",
"@typescript-eslint/parser": "^7.18.0",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.1",
"eslint-config-next": "15.0.0-rc.0",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-react-hooks": "^4.6.2",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.12",
},
"overrides": {
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc"
}
} |
Beta Was this translation helpful? Give feedback.
-
Add
This work for me. |
Beta Was this translation helpful? Give feedback.
-
Upgrading Node.JS to 22.9 fixed it for me. |
Beta Was this translation helpful? Give feedback.
-
Link to the code that reproduces this issue
https://github.com/PBnJson/reproduction-template
To Reproduce
Current vs. Expected behavior
I expected the project to build and be minified but instead I had to disable minification with swcMinify:false in order to build successfully.
Provide environment information
Which area(s) are affected? (Select all that apply)
Runtime, Script (next/script)
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
I'm deploying in Google Cloud vm instance with Debian. The app was working great before I added the service workers. The error happens at
invalid unicode code point at line 1 column 43757
when I rundocker compose up --build
. DisablingswcMinify
in next.config.js got the build to succeed, so some sort of minification issue.reproduction-template
Beta Was this translation helpful? Give feedback.
All reactions