You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am receiving the following output when trying to create snapshot
Creating a linked script..
running in context
Generating startup blob in "/Users/seanaye/dev/coparse/pdf-reader/packages/app/cache"
Loading script for embedding: /Users/seanaye/dev/coparse/pdf-reader/packages/app/cache/snapshot.js
Error running mksnapshot.
Error: Error in mksnapshot
at main (/Users/seanaye/dev/coparse/pdf-reader/packages/app/scripts/createSnapshot.js:49:11)
script to generate the snapshot
constchildProcess=require('child_process');constvm=require('vm');constpath=require('path');constfs=require('fs');constelectronLink=require('electron-link');constexcludedModules={};asyncfunctionmain(){constbaseDirPath=path.resolve(__dirname,'..');constmainPath=`${baseDirPath}/src/snapshot/imports.js`;console.log('Creating a linked script..');constresult=awaitelectronLink({baseDirPath: baseDirPath,
mainPath,cachePath: `${baseDirPath}/cache`,shouldExcludeModule: (modulePath)=>excludedModules.hasOwnProperty(modulePath),});constsnapshotScriptPath=`${baseDirPath}/cache/snapshot.js`;fs.writeFileSync(snapshotScriptPath,result.snapshotScript);// Verify if we will be able to use this in `mksnapshot`console.log('running in context');vm.runInNewContext(result.snapshotScript,undefined,{filename: snapshotScriptPath,displayErrors: true,});constoutputBlobPath=path.resolve(__dirname,'../cache/');console.log(`Generating startup blob in "${outputBlobPath}"`);try{childProcess.execFileSync(path.resolve(__dirname,'..','node_modules','.bin','mksnapshot'+(process.platform==='win32' ? '.cmd' : '')),[snapshotScriptPath,'--output_dir',outputBlobPath],{stdio: 'inherit'});}catch{// actual errors go to stdiothrownewError("Error in mksnapshot")}}main().then(()=>console.log('done'),(err)=>console.error(err));
This was previously working fine. after re-downloading electron things stopped working. The script executes correctly in runInNewContext as well
I am receiving the following output when trying to create snapshot
script to generate the snapshot
This was previously working fine. after re-downloading electron things stopped working. The script executes correctly in
runInNewContext
as wellcontents of the
snapshot/imports.js
fileResolved package versions
"electron-mksnapshot": "^21.0.0",
"electron": "^21.2.3",
"electron-link": "^0.6.0",
System info:
MacOS 12.6 arm64
The text was updated successfully, but these errors were encountered: