electron-prebuilt-compile
electron-prebuilt-compile copied to clipboard
`cachedir` argument causes error when app run
When I run electron app with cachedir
argument electron . -c ./.cache/
to specify the cache directory of electron-compile
, it runs correctly if ./.cache/
directory does not exist, but when I close and run the app again (./.cache/
is created and populated with cache data), it threw this error:
App threw an error during load
Error: Asked for /Users/huy/Workspace/js/electron/electron-compile-boilerplate/app/main.ts but it was not precompiled!
at FileChangedCache.getHashForPathSync (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/file-change-cache.js:313:15)
at CompilerHost.compileReadOnlySync (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/compiler-host.js:545:41)
at CompilerHost.compileSync (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/compiler-host.js:470:37)
at Object.require.extensions.(anonymous function) [as .ts] (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/require-hook.js:66:48)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at init (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-compile/lib/config-parser.js:292:16)
at main (/Users/huy/Workspace/js/electron/electron-compile-boilerplate/node_modules/electron-prebuilt-compile/lib/es6-init.js:40:29)
I don't get that error when I run without the cachedir
argument (electron-compile
will use the default temporary directory cache compileCache_
)