-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
node_mksnapshot.exe
fails with SyntaxError: Invalid or unexpected token
#48987
Comments
It's just a guess, but does removing the |
Hmm, wait, we don't turn these on on Windows anyway, so it's probably not related to the use of string literals. It could still be related to UTF16 encoding though, because it fails in |
@joyeecheung Genius! Replacing |
I verified that I could still build the main branch with Visual Studio 2022. I think one possible cause might be that the check out on your machine is not in UTF8? We assume the JS files on disk are encoded in UTF8 and transcode them to UTF16 if they contain 2 byte characters (if they only contain ASCII characters, they are copied verbatim). |
@joyeecheung The SHA-1 sum of the file is the same on Windows and on my usual Ubuntu setup, and it renders correctly when I open it as a UTF-8 text file on Windows. |
@tniessen Can you comment out the NODE_JS2C_USE_STRING_LITERALS part in node.gyp and build on different machines, then compare the output of |
While doing the GHC a few folks faced this error. No easy workaround though. |
@joyeecheung Sorry, I (fortunately) didn't have to go back to Windows once you'd provided a (genius) workaround. |
Do we have a
|
Sounds like a git encoding issue. You can configure it to change the encoding on checkout. Should be fixable by adding lib/internal/timers.js and deps/undici/undici.js to .gitattributes. |
It seems the OP was using VS2019, I wonder if others encountering the same issue are also using VS2019. If so, this might be fixed by #50091 (see simdutf/simdutf#328 for the reason, that explained why I couldn't reproduce it with VS2022) |
Sorry @joyeecheung, I (luckily) didn't get back to any Windows setup since you provided the workaround. |
I (luckily) haven't had to build Node.js on Windows in a long time, but I (unfortunately) need to now. With the main branch checked out at d396a04 and no unstaged changes, I see the following error at the end of the build process:
The file
lib/internal/timers.js
is unmodified. Its SHA-1 checksum is716eccf542993957462b7ad0b9c13db91c046cec
.The text was updated successfully, but these errors were encountered: