ts-loader
ts-loader copied to clipboard
TypeError: loaderContext.getOptions is not a function
yntax Error: TypeError: loaderContext.getOptions is not a function
@ multi (webpack)-dev-server/client?http://localhost:8081/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts
I upgraded my app from vue 3 js to vue 3 typescript and this error occurs when i try to start the dev server:
I tried to downgrade webpack to version 4, also the ts-loader to 8.2.0 and node version but non of these works.
Does anybody solved this issue?
I have same issue, after upgrading it to latest version
Me too. I used vue-cli to initialize a vue3 project and then executed vue add electron-builder
.
Run npm run serve
was successfully.
Run npm run electron:serve
was faild.
error in ./src/background.ts
Module build failed (from ./node_modules/ts-loader/index.js):
TypeError: loaderContext.getOptions is not a function
at getLoaderOptions (/xxx/node_modules/ts-loader/dist/index.js:91:41)
at Object.loader (/xxx/node_modules/ts-loader/dist/index.js:14:21)
@ multi ./src/background.ts
I am also experiencing this issue on a vue 3 ts project
I found a workaround to downgrade only ts-loader
v8 even if i use [email protected]
.
yarn add -D "ts-loader"@"^8.4.0"
You need webpack v5 to use the latest version of ts-loader