microsoft / TypeScript-React-Starter

A starter template for TypeScript and React with a detailed README describing how to use the two together.
MIT License
11.09k stars 1.21k forks source link

Failed to load tsconfig.json: Missing baseUrl in compilerOptions #122

Open Liero opened 6 years ago

Liero commented 6 years ago

When I run in VS Code terminal npm start I get:

react-scripts-ts start

Failed to load tsconfig.json: Missing baseUrl in compilerOptions Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin Found no baseUrl in tsconfig.json, not applying tsconfig-paths-webpack-plugin

I've only added 'npm install --save react-bootstrap @types/react-bootstrap`

Meligy commented 6 years ago

I can also reproduce this with

npx create-react-app my-t-app --scripts-version=react-scripts-ts
cd my-t-app
npm run build

Output of npm version:

{ 'my-t-app': '0.1.0',
  npm: '5.7.1',
  ares: '1.10.1-DEV',
  cldr: '32.0.1',
  http_parser: '2.7.0',
  icu: '60.2',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.4',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.15.0',
  v8: '6.1.534.50',
  zlib: '1.2.11' }

Output of npm ls --depth=0:

my-t-app@0.1.0 /Users/Meligy/Code/temp/rct/my-t-app
├── @types/jest@22.1.4
├── @types/node@9.4.6
├── @types/react@16.0.40
├── @types/react-dom@16.0.4
├── react@16.2.0
├── react-dom@16.2.0
├── react-scripts-ts@2.13.0
└── typescript@2.7.2
nick-gaudreau commented 6 years ago

You can add "baseUrl": "." to your tsconfig.json: { "compilerOptions": { "baseUrl": "."

},