title: React TypeScript Application gets 'TS2304: Cannot find name 'Text'.'
body: <p>This is the dependencies in my package.json. this used to work for me in the past. </p>
  
  <pre><code>{
    "name": "login-ts-react",
    "version": "1.0.0",
    "main": "webpack.config.js",
    "scripts": {
      "start": "webpack-dev-server"
    },
    "repository": "https://github.com/abhsrivastava/login-ts-react.git",
    "author": "Abhishek Srivastava &lt;abhsrivastava@foo&gt;",
    "license": "MIT",
    "dependencies": {
      "react": "^16.3.2",
      "react-bootstrap": "^0.32.1",
      "react-dom": "^16.3.2"
    },
    "devDependencies": {
      "@types/react": "^16.3.13",
      "@types/react-bootstrap": "^0.32.9",
      "@types/react-dom": "^16.0.5",
      "awesome-typescript-loader": "^5.0.0",
      "css-loader": "^0.28.11",
      "html-webpack-plugin": "^3.2.0",
      "import-glob-loader": "^1.1.0",
      "mini-css-extract-plugin": "^0.4.0",
      "node-sass": "^4.9.0",
      "sass-loader": "^7.0.1",
      "source-map-loader": "^0.2.3",
      "style-loader": "^0.21.0",
      "typescript": "^2.8.3",
      "webpack": "^4.6.0",
      "webpack-cli": "^2.0.15",
      "webpack-dev-server": "^3.1.3"
    }
  }
  </code></pre>
  
  <p>My tsconfig.js looks like</p>
  
  <pre><code>"target": "es5",
  "lib": ["es6"],
  "module": "commonjs",
  "jsx": "react",
  "sourceMap": true,
  "outDir": "./build",
  "removeComments": true,
  "strict": true,
  "noImplicitAny": true,
  "strictPropertyInitialization": true,
  "noImplicitThis": true,
  "alwaysStrict": true,
  "noUnusedLocals": true,
  "noUnusedParameters": true,
  "noImplicitReturns": true,
  "noFallthroughCasesInSwitch": true,
  "baseUrl": "./src",
  "esModuleInterop": true
  </code></pre>
  
  <p>When I do <code>yarn start</code> I get error</p>
  
  <pre><code>ERROR in [at-loader] ./node_modules/@types/react-dom/index.d.ts:19:72
      TS2304: Cannot find name 'Text'.
  
  ERROR in [at-loader] ./src/index.tsx:6:28
      TS2304: Cannot find name 'document'.
  </code></pre>
  
  <p>I had created an application last week with this very same package.json and it was working without these errors.</p>
  
  <p>Edit:: Based on the answers below I tried two things</p>
  
  <p>tsconfig.js</p>
  
  <pre><code>"target": "es6",
  "lib": ["es6"],
  "jsx": "react",
  </code></pre>
  
  <p>Now when I do yarn start I get error</p>
  
  <pre><code>ERROR in [at-loader] ./node_modules/@types/react-dom/index.d.ts:19:72
      TS2304: Cannot find name 'Text'.
  
  ERROR in [at-loader] ./src/index.tsx:5:28
      TS2304: Cannot find name 'document'.
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>"target": "es5",
  "lib": ["es6", "dom"],
  "module": "commonjs",
  </code></pre>
  
  <p>Now I get error</p>
  
  <pre><code>ERROR in [at-loader] ./node_modules/@types/node/index.d.ts:2381:15
      TS2300: Duplicate identifier 'URL'.
  
  ERROR in [at-loader] ./node_modules/@types/node/index.d.ts:2399:15
      TS2300: Duplicate identifier 'URLSearchParams'.
  
  ERROR in [at-loader] ./node_modules/@types/node/index.d.ts:2417:14
      TS2661: Cannot export 'URL'. Only local declarations can be exported from a module.
  
  ERROR in [at-loader] ./node_modules/@types/node/index.d.ts:2417:19
      TS2661: Cannot export 'URLSearchParams'. Only local declarations can be exported from a module.
  Child html-webpack-plugin for "index.html":
  </code></pre>