Skip to content
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

error rebuild electron 18.0.0 on Windows #1005

Open
songzhj opened this issue Apr 15, 2022 · 8 comments
Open

error rebuild electron 18.0.0 on Windows #1005

songzhj opened this issue Apr 15, 2022 · 8 comments

Comments

@songzhj
Copy link

songzhj commented Apr 15, 2022

On Mac, electron-rebuild -v 18.0.0 is OK.
On Windows, electron-rebuild -v 17.0.0 will success, but electron-rebuild -v 18.0.0 will get errors:

Building module: tutor-mupdf-addon, Completed: 0

c:\users\feixiang\.electron-gyp\18.0.0\include\node\v8-traced-handle.h(240): error C2061: 语法错误: 标识符“TracedGlobal<`templ
ate-type-parameter-1'>” [D:\code\tutor-mupdf-addon\build\tutor-mupdf-addon.vcxproj]
  c:\users\feixiang\.electron-gyp\18.0.0\include\node\v8-traced-handle.h(335): note: 参见对正在编译的 类 模板 实例化 "v8::TracedGloba
  l<T>" 的引用
c:\users\feixiang\.electron-gyp\18.0.0\include\node\v8-traced-handle.h(240): error C2334: “:”的前面有意外标记;跳过明 显的函数体 [D:\code
\tutor-mupdf-addon\build\tutor-mupdf-addon.vcxproj]
c:\users\feixiang\.electron-gyp\18.0.0\include\node\v8-traced-handle.h(22): fatal error C1075: “{”: 未找到匹配令牌 [D:\code\tu
tor-mupdf-addon\build\tutor-mupdf-addon.vcxproj]
× Rebuild Failed


An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'D:\code\tutor-mupdf-addon'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".


Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe` failed with exit code: 1






Error: node-gyp failed to rebuild 'D:\code\tutor-mupdf-addon'.
For more information, rerun with the DEBUG environment variable set to "electron-rebuild".


Error: `C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe` failed with exit code: 1




    at NodeGyp.rebuildModule (D:\Code\tutor-mupdf-addon\node_modules\electron-rebuild\lib\src\module-type\node-gyp.js:117:19)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async ModuleRebuilder.rebuildNodeGypModule (D:\Code\tutor-mupdf-addon\node_modules\electron-rebuild\lib\src\module-rebuilder.js:94:9)
    at async ModuleRebuilder.rebuild (D:\Code\tutor-mupdf-addon\node_modules\electron-rebuild\lib\src\module-rebuilder.js:124:14)
    at async Rebuilder.rebuildModuleAt (D:\Code\tutor-mupdf-addon\node_modules\electron-rebuild\lib\src\rebuild.js:145:13)
    at async Rebuilder.rebuild (D:\Code\tutor-mupdf-addon\node_modules\electron-rebuild\lib\src\rebuild.js:108:17)
    at async D:\Code\tutor-mupdf-addon\node_modules\electron-rebuild\lib\src\cli.js:154:9
error Command failed with exit code 4294967295.

Why and how to resolve it ?

@retsimx
Copy link

retsimx commented Apr 16, 2022

+1

@kryops
Copy link

kryops commented Apr 26, 2022

We had the same problem in a build using Node 14 and Visual Studio 2017 (MSBuild 15). Builds using Node 16 and Visual Studio 2022 (MSBuild 17) do not seem to be affected.

In our concrete case, we worked around the problem by updating our native dependency to a version that has prebuilt binaries for Electron 18.

@Ciberusps
Copy link

Same trouble

  • with electron@16 works fine
  • with electron@18 rebuild broken
c:\users\ciber\.electron-gyp\18.0.1\include\node\v8-traced-handle.h(240): error C2061: syntax error: identifier 'Tr
acedGlobal<`template-type-parameter-1'>' [F:\FireSave\release\app\node_modules\greenworks\build\greenworks-win64.vc
xproj]
  c:\users\ciber\.electron-gyp\18.0.1\include\node\v8-traced-handle.h(335): note: see reference to class template i
  nstantiation 'v8::TracedGlobal<T>' being compiled
c:\users\ciber\.electron-gyp\18.0.1\include\node\v8-traced-handle.h(240): error C2334: unexpected token(s) precedin
g ':'; skipping apparent function body [F:\FireSave\release\app\node_modules\greenworks\build\greenworks-win64.vcxp
roj]
c:\users\ciber\.electron-gyp\18.0.1\include\node\v8-traced-handle.h(22): fatal error C1075: '{': no matching token
found [F:\FireSave\release\app\node_modules\greenworks\build\greenworks-win64.vcxproj]

@jurkog
Copy link

jurkog commented May 3, 2022

+1

@Ciberusps
Copy link

Looks like it works now, dont know what changed, anybody still experience issue?

@kryops
Copy link

kryops commented Jun 8, 2022

Might have been fixed by electron/electron#34109

I will try tomorrow and see if I can still reproduce it in my project.

@kryops
Copy link

kryops commented Jun 9, 2022

Works again for me too 🚀

@Joey-Coder
Copy link

I try to electron-rebuild -v 18.0.0 -f -w better-sqlite3 with VS2017, But it throw some c++ compile error.

But it is work in VS2019, so I guess it maybe relate with VS version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants