Failed to load tsconfig.json: Missing baseUrl in compilerOptions
See original GitHub issueNo idea what’s going on here. My tsconfig.json:
project/tsonfig.json
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"module": "esnext",
"removeComments": false,
"sourceMap": true,
"isolatedModules": false,
"strictNullChecks": true,
"target": "esnext",
"moduleResolution": "node",
"jsx": "react",
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"lib": ["dom", "esnext"],
"baseUrl": ".",
"paths": {
"Audio/*": ["./app/assets/audios/*"],
"Components/*": ["./app/assets/javascripts/components/*"],
"Constants/*": ["./app/assets/javascripts/constants/*"],
"Decorators/*": ["./app/assets/javascripts/components/decorators/*"],
"Images/*": ["app/assets/images/*"],
"Math/*": ["./app/assets/javascripts/math/*"],
"Redux/*": ["./app/assets/javascripts/redux/*"],
"Routes": ["./app/assets/javascripts/rails-routes.js.erb"],
"Services/*": ["./app/assets/javascripts/services/*"],
"Stylesheets/*": ["./app/assets/stylesheets/*"],
"Types": ["./app/assets/javascripts/types/index"],
"Utilities/*": ["./app/assets/javascripts/utilities/*"],
"react": ["node_modules/@types/react"]
},
"preserveConstEnums": true
},
"include": [
"app/assets/javascripts/**/*.ts",
"app/assets/javascripts/**/*.tsx",
"stories/**/*.ts",
"stories/**/*.tsx"
],
"exclude": ["node_modules"]
}
webpack.config.ts
// ...
resolve: {
plugins: [
new TsconfigPathsPlugin({
baseUrl: __dirname,
extensions: [".js", ".ts", ".tsx"],
}),
],
// ...
This error doesn’t make sense because, firstly, tsconfig.json has a baseUrl, and secondly, it doesn’t need one because I’ve included it in the options.
Also, this should kill the build rather than just logging. If it can’t find the file then what’s the point of continuing to run? The paths will not resolve.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Failed to load tsconfig.json: Missing baseUrl in compilerOptions
When I run in VS Code terminal npm start I get: react-scripts-ts start Failed to load tsconfig.json: Missing baseUrl in compilerOptions ...
Read more >What is the baseUrl in compilerOptions used for? : r/typescript
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped. I am wondering if it's something I should have or not.
Read more >compilerOptions.paths must not be set (alias imports are not ...
I've solved this issue by moving the baseUrl to the main tsconfig.json file like below: tsconfig: { "extends": "./tsconfig.paths.json", "compilerOptions": ...
Read more >nrwl-nx/community - Gitter
Failed to load tsconfig.json : Missing baseUrl in compilerOptions Starting type checking service... Using 6 workers with 2048MB memory limit ...
Read more >dividab - Bountysource
Failed to load tsconfig.json : Missing baseUrl in compilerOptions tsconfig-paths-webpack-plugin: Found no baseUrl in tsconfig.json, not applying ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I solve this problem by below code
delete process.env.TS_NODE_PROJECT
add this code on top of webapck.config.ts file.👍
Okey i got it to work.
I was in a hurry and i didn’t figured that i put my plugin initilization under resolve: {} property. I was configuring it under root plugin: [] property. So moving my configuration to resolve: {} fixes everything.