node-gyp build problems with @sapphire/type

Trying to install @sapphire/type, bufferutil or other native libraries fails on my windows machine. Visual studio throws syntax errors parsing the node includes. The problem does not occur with clang on my linux machine. As vs22 is the recommend version for node-gyp 10.1.0, I'm puzzled what the error might be, however I have no direct experience with node modules in this sense. Node Version: v22.1.0 node-gyp Version: 10.1.0 Python Version: Python 3.12.3 VS Version: 17.9.6 Enterprise with C++ Desktop Development workload
Solution:
GitHub
Can't compile simple program on Windows with Node.js 22 · Issue #96...
With nan 2.19, a barebones simple program fails to compile on Windows. Attached is the full program (zipped). To test the failure: unzip nantest.zip Run npm install If compilation is successful, yo...
Jump to solution
37 Replies
Favna
Favna6mo ago
Downgrade back to Node 20. This often happens when you try to be on the cutting edge versions. It appears that Node 22 broke something with the lib. CC @kyra 🩵🩷🤍🩷🩵 and @vladdy because it's the C code.
vladdy
vladdy6mo ago
woooo useless errors 🥴
Favna
Favna6mo ago
it should also be noted that we haven't even updated our CI yet to build for Node 22. It's barely been released too, only for a little over a week. It's never wise to be on such cutting edge releases. Always let versions of things like Node, Python, etc settle, give it a few months, then update
vladdy
vladdy6mo ago
also it built just fine on mac on node 22 lets see what ci says .../node_modules/@sapphire/type install: <string>:13: SyntaxWarning: invalid escape sequence '\$' wtf
fantasy
fantasy6mo ago
22.0.0 or 22.1.0?
vladdy
vladdy6mo ago
22.0.0 i can jump to 22.1
fantasy
fantasy6mo ago
just downgraded to 22.0.0, that also works on windows
vladdy
vladdy6mo ago
FASCINATING it..built with more warnings but it built
vladdy
vladdy6mo ago
too slow favna too slow i already opened the PR :CLk_Kekega:
Favna
Favna6mo ago
says the guy who didnt update all three files
vladdy
vladdy6mo ago
idc :meguFace: also wdym 3 files
Favna
Favna6mo ago
did find-and-replace abandon your sanity
vladdy
vladdy6mo ago
i literally checked all workflows :dead: wtf
Favna
Favna6mo ago
you forgot to update release-updater.yml
vladdy
vladdy6mo ago
this some bullllllshit
Favna
Favna6mo ago
also
No description
vladdy
vladdy6mo ago
anyways idk why it doesnt build cuz like...locally it built fine inb4 yet another windows moment
Favna
Favna6mo ago
GH wont have 22.1.0 yet for sure since it released literally today
vladdy
vladdy6mo ago
It does lol and it looks to be a non-us issue since the error comes from
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\22.1.0\include\node\v8-function-callback.h(408,62): warning C4003: not enough arguments for function-like macro invocation 'min' [D:\a\type\type\build\type.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\22.1.0\include\node\v8-function-callback.h(409,62): warning C4003: not enough arguments for function-like macro invocation 'max' [D:\a\type\type\build\type.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\22.1.0\include\node\v8-function-callback.h(408,62): error C2589: '(': illegal token on right side of '::' [D:\a\type\type\build\type.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\22.1.0\include\node\v8-function-callback.h(408,62): warning C4003: not enough arguments for function-like macro invocation 'min' [D:\a\type\type\build\type.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\22.1.0\include\node\v8-function-callback.h(409,62): warning C4003: not enough arguments for function-like macro invocation 'max' [D:\a\type\type\build\type.vcxproj]
C:\Users\runneradmin\AppData\Local\node-gyp\Cache\22.1.0\include\node\v8-function-callback.h(408,62): error C2589: '(': illegal token on right side of '::' [D:\a\type\type\build\type.vcxproj]
Favna
Favna6mo ago
oh github is actually fast for a change
vladdy
vladdy6mo ago
need i remind you github doesnt need to do anything as we rely on setup-node which fetches from the registry?
Favna
Favna6mo ago
look at the URL
No description
vladdy
vladdy6mo ago
pretty sure it has fallbacks
vladdy
vladdy6mo ago
yeah but not our fault
vladdy
vladdy6mo ago
seems like its something to do with windows and node 22 which :shrug:
Favna
Favna6mo ago
so that confirms the issue anyway @fantasy
fantasy
fantasy6mo ago
guess ill have to stick with the 22.0.0 then
vladdy
vladdy6mo ago
or... 20 which is still LTS for a while
fantasy
fantasy6mo ago
._. wheres the fun if it were to just work :^)
vladdy
vladdy6mo ago
it seems like node encountered some v8 bugs too its fun this is why you dont rush new majors :KEKW:
fantasy
fantasy6mo ago
https://github.com/nodejs/node/pull/52794 fixes it, but im still searching where it was introduced
GitHub
build: define NOMINMAX in common.gypi by legendecas · Pull Reques...
V8 and Node.js had defined NOMINMAX on Windows for a long time. In recent changes, V8 added std::numeric_limits::min usages in its header files which caused addons without NOMINMAX defines failed ...
Solution
fantasy
fantasy6mo ago
GitHub
Can't compile simple program on Windows with Node.js 22 · Issue #96...
With nan 2.19, a barebones simple program fails to compile on Windows. Attached is the full program (zipped). To test the failure: unzip nantest.zip Run npm install If compilation is successful, yo...
fantasy
fantasy6mo ago
(so i can accept an answer that gets updated)
fantasy
fantasy6mo ago
zlib-sync still broken with 22.0.0, lts it is then
Want results from more Discord servers?
Add your server