Javascriptservices: Yeoman generator: issues with NPM package versions

Created on 19 Jul 2017  路  1Comment  路  Source: aspnet/JavaScriptServices

I have run into this problem a few times, and I've found that I've had to install more recent versions of some packages, namely Typescript.

The issue occurs when running yo aspnetcore-spa, and the error messages are as follows:

ERROR in [at-loader] ./ClientApp/routes.tsx:9:12 
    TS2322: Type '{ exact: true; path: "/"; component: typeof Home; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Route<T>> & Readonly<{ children?: ReactNode; }> & ...'.
  Type '{ exact: true; path: "/"; component: typeof Home; }' is not assignable to type 'Readonly<T>'.

ERROR in [at-loader] ./ClientApp/routes.tsx:10:12 
    TS2322: Type '{ path: "/counter"; component: typeof Counter; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Route<T>> & Readonly<{ children?: ReactNode; }> & ...'.
  Type '{ path: "/counter"; component: typeof Counter; }' is not assignable to type 'Readonly<T>'.

ERROR in [at-loader] ./ClientApp/routes.tsx:11:12 
    TS2322: Type '{ path: "/fetchdata/:startDateIndex?"; component: typeof FetchData; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Route<T>> & Readonly<{ children?: ReactNode; }> & ...'.
  Type '{ path: "/fetchdata/:startDateIndex?"; component: typeof FetchData; }' is not assignable to type 'Readonly<T>'.

ERROR in [at-loader] ./node_modules/@types/react-router/index.d.ts:67:21 
    TS2694: Namespace 'React' has no exported member 'ComponentType'.

ERROR in [at-loader] ./node_modules/@types/react-router/index.d.ts:102:48 
    TS2694: Namespace 'React' has no exported member 'ComponentType'.

Most helpful comment

Just found this issue referenced in #1120 and #1099. The fix is to update the following packages to the following versions:

...
"@types/react": "15.0.35",
"@types/react-dom": "15.5.1",
"@types/react-redux": "4.4.45",
"@types/react-router-dom": "4.0.6",
"@types/react-router-redux": "5.0.3",
...
"typescript": "2.3.4",

>All comments

Just found this issue referenced in #1120 and #1099. The fix is to update the following packages to the following versions:

...
"@types/react": "15.0.35",
"@types/react-dom": "15.5.1",
"@types/react-redux": "4.4.45",
"@types/react-router-dom": "4.0.6",
"@types/react-router-redux": "5.0.3",
...
"typescript": "2.3.4",
Was this page helpful?
0 / 5 - 0 ratings

Related issues

uNkNowN92-git picture uNkNowN92-git  路  3Comments

natemcmaster picture natemcmaster  路  4Comments

asadsahi picture asadsahi  路  3Comments

dantheman999301 picture dantheman999301  路  4Comments

AmrineA picture AmrineA  路  3Comments