tree-sitter / tree-sitter-javascript

Javascript grammar for tree-sitter
MIT License
314 stars 108 forks source link

Error during build #309

Closed SFX123456 closed 1 month ago

SFX123456 commented 1 month ago

hello, i cant run npm run build without facing this error. PS E:\hjbsdfh\node_modules\tree-sitter-javascript> npm run build

tree-sitter-javascript@0.20.4 build tree-sitter generate && node-gyp build

gyp info it worked if it ends with ok gyp info using node-gyp@9.4.0 gyp info using node@20.9.0 | win32 | x64 gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe gyp info spawn args [ gyp info spawn args 'build/binding.sln', gyp info spawn args '/clp:Verbosity=minimal', gyp info spawn args '/nologo', gyp info spawn args '/p:Configuration=Release;Platform=x64' gyp info spawn args ] Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "-m" hinzufügen. parser.c Bibliothek "E:\hjbsdfh\node_modules\tree-sitter-javascript\build\Release\tree_sitter_javascript_binding.lib" und O bjekt "E:\hjbsdfh\node_modules\tree-sitter-javascript\build\Release\tree_sitter_javascript_binding.exp" werden erstel lt. parser.obj : error LNK2001: Nicht aufgelöstes externes Symbol "tree_sitter_javascript_external_scanner_destroy". [E:\hj bsdfh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxproj] parser.obj : error LNK2001: Nicht aufgelöstes externes Symbol "tree_sitter_javascript_external_scanner_deserialize". [E :\hjbsdfh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxproj] parser.obj : error LNK2001: Nicht aufgelöstes externes Symbol "tree_sitter_javascript_external_scanner_create". [E:\hjb sdfh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxproj] parser.obj : error LNK2001: Nicht aufgelöstes externes Symbol "tree_sitter_javascript_external_scanner_scan". [E:\hjbsd fh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxproj] parser.obj : error LNK2001: Nicht aufgelöstes externes Symbol "tree_sitter_javascript_external_scanner_serialize". [E:\ hjbsdfh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxproj] E:\hjbsdfh\node_modules\tree-sitter-javascript\build\Release\tree_sitter_javascript_binding.node : fatal error LNK1120: 5 nicht aufgelöste Externe [E:\hjbsdfh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxpro j] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe failed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\Nico\AppData\Roaming\nvm\v20.9.0\node_modules\npm\node_modules\node-gyp\lib\build.js:203:23) gyp ERR! stack at ChildProcess.emit (node:events:514:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12) gyp ERR! System Windows_NT 10.0.19045 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\Nico\AppData\Roaming\nvm\v20.9.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "build" gyp ERR! cwd E:\hjbsdfh\node_modules\tree-sitter-javascript gyp ERR! node -v v20.9.0 gyp ERR! node-gyp -v v9.4.0 gyp ERR! not ok

its german unfortunately but it basically says there is an unresolved external symbol "tree_sitter_javascript_external_scanner_destroy". [E:\hjbsdfh\node_modules\tree-sitter-javascript\build\tree_sitter_javascript_binding.vcxproj] 5 times

there is my tree_sitter_javascript_binding.vcxproj file. i need to recompile as i get the following error https://github.com/tree-sitter/node-tree-sitter/issues/193

<?xml version="1.0" encoding="utf-8"?>

Debug x64 Release x64 {2B00F4D4-8CB6-5DA3-ABE6-EBBC68CF6EEF} Win32Proj tree_sitter_javascript_binding true x64 10.0.19041.0 DynamicLibrary v142 $(ExecutablePath);$(MSBuildProjectDirectory)\..\bin\;$(MSBuildProjectDirectory)\..\bin\ true $(Configuration)\obj\$(ProjectName)\ false true $(SolutionDir)$(Configuration)\ .node .node .node .node $(ProjectName) $(OutDir)\$(ProjectName).node C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\include\node;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\src;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\config;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\openssl\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\uv\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\zlib;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\v8\include;..\src;..\..\node-addon-api;%(AdditionalIncludeDirectories) /Zc:__cplusplus -std:c++17 %(AdditionalOptions) EnableFastChecks true OldStyle 4351;4355;4800;4251;4275;4244;4267;%(DisableSpecificWarnings) true Sync false true false Disabled NotUsing NODE_GYP_MODULE_NAME=tree_sitter_javascript_binding;USING_UV_SHARED=1;USING_V8_SHARED=1;V8_DEPRECATION_WARNINGS=1;V8_DEPRECATION_WARNINGS;V8_IMMINENT_DEPRECATION_WARNINGS;_GLIBCXX_USE_CXX11_ABI=1;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_HAS_EXCEPTIONS=0;OPENSSL_NO_PINSHARED;OPENSSL_THREADS;NAPI_CPP_EXCEPTIONS;_HAS_EXCEPTIONS=1;BUILDING_NODE_EXTENSION;HOST_BINARY="node.exe";DEBUG;_DEBUG;V8_ENABLE_CHECKS;%(PreprocessorDefinitions) MultiThreadedDebug true true false Level3 true /LTCG:INCREMENTAL %(AdditionalOptions) kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;DelayImp.lib;"C:\\Users\\Nico\\AppData\\Local\\node-gyp\\Cache\\20.9.0\\x64\\node.lib" /LTCG:INCREMENTAL /ignore:4199 %(AdditionalOptions) node.exe;%(DelayLoadDLLs) true true true $(OutDir)$(ProjectName).node true .node MachineX64 C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\include\node;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\src;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\config;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\openssl\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\uv\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\zlib;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\v8\include;..\src;..\..\node-addon-api;%(AdditionalIncludeDirectories) NODE_GYP_MODULE_NAME=tree_sitter_javascript_binding;USING_UV_SHARED=1;USING_V8_SHARED=1;V8_DEPRECATION_WARNINGS=1;V8_DEPRECATION_WARNINGS;V8_IMMINENT_DEPRECATION_WARNINGS;_GLIBCXX_USE_CXX11_ABI=1;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_HAS_EXCEPTIONS=0;OPENSSL_NO_PINSHARED;OPENSSL_THREADS;NAPI_CPP_EXCEPTIONS;_HAS_EXCEPTIONS=1;BUILDING_NODE_EXTENSION;HOST_BINARY="node.exe";DEBUG;_DEBUG;V8_ENABLE_CHECKS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\include\node;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\src;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\config;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\openssl\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\uv\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\zlib;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\v8\include;..\src;..\..\node-addon-api;%(AdditionalIncludeDirectories) /Zc:__cplusplus -std:c++17 %(AdditionalOptions) true OldStyle 4351;4355;4800;4251;4275;4244;4267;%(DisableSpecificWarnings) true Sync Speed true AnySuitable true true true Full NotUsing NODE_GYP_MODULE_NAME=tree_sitter_javascript_binding;USING_UV_SHARED=1;USING_V8_SHARED=1;V8_DEPRECATION_WARNINGS=1;V8_DEPRECATION_WARNINGS;V8_IMMINENT_DEPRECATION_WARNINGS;_GLIBCXX_USE_CXX11_ABI=1;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_HAS_EXCEPTIONS=0;OPENSSL_NO_PINSHARED;OPENSSL_THREADS;NAPI_CPP_EXCEPTIONS;_HAS_EXCEPTIONS=1;BUILDING_NODE_EXTENSION;HOST_BINARY="node.exe";%(PreprocessorDefinitions) MultiThreaded false true true false Level3 true /LTCG:INCREMENTAL %(AdditionalOptions) kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;DelayImp.lib;"C:\\Users\\Nico\\AppData\\Local\\node-gyp\\Cache\\20.9.0\\x64\\node.lib" /LTCG:INCREMENTAL /ignore:4199 %(AdditionalOptions) node.exe;%(DelayLoadDLLs) true true true $(OutDir)$(ProjectName).node true .node MachineX64 C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\include\node;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\src;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\config;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\openssl\openssl\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\uv\include;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\zlib;C:\Users\Nico\AppData\Local\node-gyp\Cache\20.9.0\deps\v8\include;..\src;..\..\node-addon-api;%(AdditionalIncludeDirectories) NODE_GYP_MODULE_NAME=tree_sitter_javascript_binding;USING_UV_SHARED=1;USING_V8_SHARED=1;V8_DEPRECATION_WARNINGS=1;V8_DEPRECATION_WARNINGS;V8_IMMINENT_DEPRECATION_WARNINGS;_GLIBCXX_USE_CXX11_ABI=1;WIN32;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_HAS_EXCEPTIONS=0;OPENSSL_NO_PINSHARED;OPENSSL_THREADS;NAPI_CPP_EXCEPTIONS;_HAS_EXCEPTIONS=1;BUILDING_NODE_EXTENSION;HOST_BINARY="node.exe";%(PreprocessorDefinitions);%(PreprocessorDefinitions) $(IntDir)\bindings\node\binding.obj $(IntDir)\src\parser.obj {B6CAB838-2818-82DF-FEE6-DF54B7BDFC07} false
SFX123456 commented 1 month ago

i tried deleting everything build wise of treesitter bash running npm run build and then npm run install. it worked. when switching grammar.js and changing the name of module.exports = grammar({ name: 'bash', to javascript it still compiles but it doesnt give out anything that makes sense. the grammar seems broken

SFX123456 commented 1 month ago

thought the scanner.c file was also auto generated. switched it and it works now when switching names etc wihtin treesitter-bash :)