AnalyticalGraphicsInc/gltf-vscode

glTF Tools crashing VS Code Extension Host when symbolic link in node_modules

canadaduane opened this issue · 5 comments

I have gltf-vscode installed as a plugin. I'm not using it for my current project--I just happen to have gltf-vscode installed from other work. Today, when I upgraded to the September release of VS Code, the Extension Host crashed unexpectedly, and continues to do so when I restart the Extension Host. It looks like gltf-vscode is causing the crash:

Extension Host
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4939 /Users/duane/.vscode/extensions/cesium.gltf-vscode-2.3.1/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:9var Module=typeof DracoDecoderModule!=="undefined"?DracoDecoderModule:{};var isRuntimeInitialized=false;var isModuleParsed=false;Module["onRuntimeInitialized"]=function(){isRuntimeInitialized=true;if(isModuleParsed){if(typeof Module["onModuleLoaded"]==="function"){Module["onModuleLoaded"](Module)}}};Module["onModuleParsed"]=function(){isModuleParsed=true;if(isRuntimeInitialized){if(typeof Module["onModuleLoaded"]==="function"){Module["onModuleLoaded"](Module)}}};function isVersionSupported(versionString){if(typeof versionString!=="string")return false;const version=versionString.split(".");if(version.length<2||version.length>3)return false;if(version[0]==1&&version[1]>=0&&version[1]<=3)return true;if(version[0]!=0||version[1]>10)return false;return true}Module["isVersionSupported"]=isVersionSupported;var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[[Error: abort(Git error {  "exitCode": 128,  "stdout": "example/.gitignore\u00001\u0000/node_modules/\u0000/Users/duane/Projects/jitsi-svelte/example/node_modules/jitsi-svelte\u0000",  "stderr": "fatal: pathspec '/Users/duane/Projects/jitsi-svelte/example/node_modules/jitsi-svelte/src' is beyond a symbolic link\n"}). Build with -s ASSERTIONS=1 for more info.	at process.abort (/Users/duane/.vscode/extensions/cesium.gltf-vscode-2.3.1/node_modules/draco3dgltf/draco_decoder_gltf_nodejs.js:35:7672)	at process.emit (events.js:228:7)	at processPromiseRejections (internal/process/promises.js:201:33)	at processTicksAndRejections (internal/process/task_queues.js:95:32)]

image

For now, I've disabled gltf-vscode as a workaround.

I notice this in your error output:

"stderr": "fatal: pathspec '/Users/duane/Projects/jitsi-svelte/example/node_modules/jitsi-svelte/src' is beyond a symbolic link\n"

This exception appears to be thrown from some module-loading code inside the Draco decoder. I'm not sure why Draco is getting involved when there are no glTF files in the project, though. I know the extension loads Draco on the Typescript side, so that it's prepared to decode buffers and such, so I guess Draco would be looking for its own dependencies at startup. I wonder if some of this could be switched to be more lazy-load, so it wouldn't try to even import Draco at all unless a glTF, preferably one bearing the Draco extension, was known to be loaded.

What platform are you on, by the way? I wonder if projects with symbolic links cause this problem now.

That sounds like a good strategy.

I'm on Mac OS 10.14.6.

gltf-vscode version 2.3.2 was just published, and includes a new version of the Draco decoder that might fix this bug. Can you re-test please? Thanks!

This should be fixed now. Let me know if it's not, thanks!