Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Cannot make it work #240

Open
painreign opened this issue Nov 30, 2018 · 6 comments
Open

Cannot make it work #240

painreign opened this issue Nov 30, 2018 · 6 comments

Comments

@painreign
Copy link

painreign commented Nov 30, 2018

I first clone master repository, then do:
npm install
npm run start

node version: 11.3.0

and then i get this output:
Failed to compile.

Error in /home/vitalik/projects/TypeScript-React-Starter/node_modules/@types/enzyme/index.d.ts
(368,15): error TS2304: Cannot find name 'Cheerio'.

Error in /home/vitalik/projects/TypeScript-React-Starter/node_modules/@types/enzyme/index.d.ts
(640,69): error TS2304: Cannot find name 'Cheerio'.

Error in /home/vitalik/projects/TypeScript-React-Starter/node_modules/@types/enzyme/index.d.ts
(13,23): error TS2688: Cannot find type definition file for 'cheerio'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(5,1): error TS2304: Cannot find name 'it'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(7,3): error TS2304: Cannot find name 'expect'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(10,1): error TS2304: Cannot find name 'it'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(12,3): error TS2304: Cannot find name 'expect'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(15,1): error TS2304: Cannot find name 'it'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(17,3): error TS2304: Cannot find name 'expect'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(20,1): error TS2304: Cannot find name 'it'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(21,3): error TS2304: Cannot find name 'expect'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(26,1): error TS2304: Cannot find name 'it'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/components/Hello.test.tsx
(27,3): error TS2304: Cannot find name 'expect'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/App.tsx
(5,14): error TS2304: Cannot find name 'require'.

Error in /home/vitalik/projects/TypeScript-React-Starter/src/App.test.tsx
(5,1): error TS2304: Cannot find name 'it'.

Error in /home/vitalik/projects/TypeScript-React-Starter/tsconfig.json
error TS2688: Cannot find type definition file for 'cheerio'.

Error in /home/vitalik/projects/TypeScript-React-Starter/tsconfig.json
error TS2688: Cannot find type definition file for 'jest'.

Error in /home/vitalik/projects/TypeScript-React-Starter/tsconfig.json
error TS2688: Cannot find type definition file for 'node'.

@xerotolerant
Copy link

Create our new project
We'll create a new project called my-app:

create-react-app my-app --scripts-version=react-scripts-ts

The readme.md clearly states that you use it this way. not the way you described

@painreign
Copy link
Author

painreign commented Dec 1, 2018 via email

@painreign painreign changed the title this shit doesn't work Cannot make it work Dec 3, 2018
@web1992
Copy link

web1992 commented Dec 4, 2018

@painreign

I think you node version 11.3.0 is newly then the TypeScript-React-Starter create.

The two way to solve:

  • 1.You use old version node (but I don't know wath's the node version when the project create)
  • 2.You still use new version code, but you must Upgrades packages to their latest version

I use Upgrades packages to their latest version ,here is step:

Upgrades packages to their latest version

yarn upgrade --latest

and then fix source file index.tsx

+ import { EnthusiasmAction } from './actions/index';
-  const store = createStore<StoreState>(enthusiasm, {
+ const store = createStore<StoreState, EnthusiasmAction, any, any>(enthusiasm, {

and then fix source file Hello.tsx

-- import { connect, Dispatch } from 'react-redux';
++ import { connect } from 'react-redux';
++ import { Dispatch } from 'redux';

Why you must fix source file , some packages(like redux) not incompatible with new version.

My node version is v10.14.1

@ramondeklein
Copy link

I have created a pull-request #242 to make it work with NodeJS v10 and React v16. I hope it will be integrated soon.

@yanlee26
Copy link

issues still exist...

@NinthDesertDude
Copy link

I got the exact same results of OP while strictly following the README. Didn't change anything, not even choosing a different name than my-app.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants