NLeSC / create-react-app

Create React apps with no build configuration.
Other
1 stars 1 forks source link

Compile error on newly created app #49

Closed dafnevk closed 7 years ago

dafnevk commented 7 years ago

If you are reporting a bug, please fill in below. Otherwise feel free to remove this template entirely.

Can you reproduce the problem with latest npm?

Yes

Description

If I create a react app with the tool, I get an compile error when running the app. npm start gives the following error: Failed to compile.

Error in C:/Users/Dafne van Kuppevelt/Documents/code/nlesc/case-law-app/src/index.tsx Module build failed: TypeError: Cannot read property 'exclude' of undefined @ multi main

npm rum build gives the following error: Module build failed: TypeError: Cannot read property 'exclude' of undefined at applyDefaults (C:\Users\Dafne van Kuppevelt\Documents\code\nlesc\case-law-app\node_modules\@nlesc\react-scripts\node_modules\awesome-typescript-loader\src\instance.ts:266:72) at Object.ensureInstance (C:\Users\Dafne van Kuppevelt\Documents\code\nlesc\case-law-app\node_modules\@nlesc\react-scripts\node_modules\awesome-typescript-loader\src\instance.ts:145:5) at compiler (C:\Users\Dafne van Kuppevelt\Documents\code\nlesc\case-law-app\node_modules\@nlesc\react-scripts\node_modules\awesome-typescript-loader\src\index.ts:37:20) at Object.loader (C:\Users\Dafne van Kuppevelt\Documents\code\nlesc\case-law-app\node_modules\@nlesc\react-scripts\node_modules\awesome-typescript-loader\src\index.ts:18:18)

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected): case-law-app@0.1.0 C:\Users\Dafne van Kuppevelt\My Documents\code\nlesc\case-law-app `-- (empty)
  2. node -v: v7.4.0
  3. npm -v: 4.0.5

Operating system: Reproduced the error on both Windows and Linux Mint

sverhoeven commented 7 years ago

typescript 2.1.4 introduced a breaking change. Downgrading typescript to 2.0.* solves the problem.

npm uninstall typescript
npm install typescript@~2.0.7
sverhoeven commented 7 years ago

Released v0.1.2 on https://www.npmjs.com/package/@nlesc/react-scripts with fix

Maartenvm commented 7 years ago

Ehmm, how is this a solution? Shouldn't we be keeping up with the latest Typescript versions?