vue-cli-plugin-electron-builder
vue-cli-plugin-electron-builder copied to clipboard
TypeError: loaderContext.getOptions is not a function
Describe the bug
ERROR Failed to compile with 1 errors 2:07:55 AM
error in ./src/background.ts
Module build failed (from ./node_modules/ts-loader/index.js):
TypeError: loaderContext.getOptions is not a function
at getLoaderOptions (/Users/xujunjie/Code/imark-installer/node_modules/ts-loader/dist/index.js:91:41)
at Object.loader (/Users/xujunjie/Code/imark-installer/node_modules/ts-loader/dist/index.js:14:21)
@ multi ./src/background.ts
ERROR Build failed with errors.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
To Reproduce Steps to reproduce the behavior:
vue -V (Output: @vue/cli 5.0.4)
vue create . (TypeScript Vue3)
vue add electron-builder (Electron 13.x.x)
Expected behavior
Start a default electron window.
Screenshots None.
Environment:
- custom config for vcp-electron-builder: None
- (if possible) link to your repo: None
- terminal output from running
vue info
:- Node: v16.14.2
- NPM: 8.5.0
- Yarn: 1.22.18
- VS Code
- macOS(x86_64) 12.3.1
Additional context
None.
Is there a plan to support electron 18.x?
I have same problem.
My Environment
- Node: 16.13.1
- npm: 8.6.0
- OS: Windows 10 10.0.19043
This problem occurred after I upgraded packages for resolving other issues of my project. I guess that it's caused by one of upgraded package, but I cannot point it out.
Here are what I upgraded:
- vue 3.0.0 -> 3.2.32
- @typescript-eslint/eslint-plugin 5.17.0 -> 5.19.0
- @typescript-eslint/parser 5.17.0 -> 5.19.0
- @vue/compiler-sfc 3.0.0 -> 3.2.32
- eslint-plugin-import 2.20.2 -> 2.26.0
- eslint-plugin-vue 8.5.0 -> 8.6.0
- eslint 8.12.0 -> 8.13.0
Have same issue with vue2
+ TypeScript
& compositionApi
.
Edited
Hello @mediasystem-slai and @bluemiaomiao,
After some few researches I found the root of this issue which is related to webpack
error : loaderContext.getOptions is not a function, I installed ts-loader@~8.2.0
and it works fine .
@annymosse Thank you
By the way, I found that it's similar to issue #1677
Solution provided by https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1714#issuecomment-1101347226
Similar to https://github.com/nklayman/vue-cli-plugin-electron-builder/issues/1768