Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

React with Redux show many errors when creating #582

Closed

Description

@sad1y

It is normal that this happens?

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.17
npm WARN ReactRedux@0.0.0 No description
npm WARN ReactRedux@0.0.0 No repository field.
npm WARN ReactRedux@0.0.0 No license field.
log  : Restoring packages for z:\projects\temp\ReactRedux\project.json...
log  : Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in z:\projects\temp\ReactRedux\project.json...
log  : Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in z:\projects\temp\ReactRedux\project.json...
log  : Restoring packages for tool 'Microsoft.DotNet.Watcher.Tools' in z:\projects\temp\ReactRedux\project.json...
log  : Writing lock file to disk. Path: z:\projects\temp\ReactRedux\project.lock.json
log  : z:\projects\temp\ReactRedux\project.json
log  : Restore completed in 5476ms.
Hash: 9e03fe6cec5d8398598c3aab4069bb548ad173b3
Version: webpack 1.14.0
Child
    Hash: 9e03fe6cec5d8398598c
    Version: webpack 1.14.0
    Time: 3651ms
                                   Asset     Size  Chunks             Chunk Names
    89889688147bd7575d6327160d64e760.svg   109 kB          [emitted]
                               vendor.js  1.73 MB       0  [emitted]  vendor
                              vendor.css   315 kB       0  [emitted]  vendor
       [0] dll vendor 12 bytes {0} [built]
        + 374 hidden modules

    WARNING in ./~/node-libs-browser/~/process/browser.js
    There is another module with an equal name when case is ignored.
    This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
    Rename module if multiple modules are expected or use equal casing if one module is expected.

    WARNING in Z:/projects/temp/ReactRedux/~/node-libs-browser/~/process/browser.js
    There is another module with an equal name when case is ignored.
    This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
    Rename module if multiple modules are expected or use equal casing if one module is expected.
    Child extract-text-webpack-plugin:
            + 7 hidden modules
Child
    Hash: 3aab4069bb548ad173b3
    Version: webpack 1.14.0
    Time: 3638ms
                                   Asset     Size  Chunks             Chunk Names
    89889688147bd7575d6327160d64e760.svg   109 kB          [emitted]
                               vendor.js  1.97 MB       0  [emitted]  vendor
       [0] dll vendor 12 bytes {0} [built]
        + 352 hidden modules
Hash: fc566f2f18fd46265e2059f70807ccc31b057bb8
Version: webpack 1.14.0
Child
    Hash: fc566f2f18fd46265e20
    Version: webpack 1.14.0
    Time: 4003ms
                 Asset      Size  Chunks             Chunk Names
        main-client.js   43.4 kB       0  [emitted]  main-client
              site.css   1.56 kB       0  [emitted]  main-client
    main-client.js.map   30.3 kB       0  [emitted]  main-client
          site.css.map  85 bytes       0  [emitted]  main-client
        + 23 hidden modules

    ERROR in Z:\projects\temp\ReactRedux\node_modules\typescript\lib\lib.dom.d.ts
    (7552,11): error TS2300: Duplicate identifier 'History'.

    ERROR in Z:\projects\temp\ReactRedux\node_modules\typescript\lib\lib.dom.d.ts
    (7562,13): error TS2300: Duplicate identifier 'History'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router-redux\node_modules\@types\history\index.d.ts
    (6,21): error TS2300: Duplicate identifier 'History'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\createMemoryHistory.d.ts
    (3,57): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryOptions'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRouterHistory.d.ts
    (1,19): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryOptions'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRouterHistory.d.ts
    (1,35): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryQueries'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRouterHistory.d.ts
    (1,51): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'CreateHistory'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRoutes.d.ts
    (4,48): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'CreateHistory'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRoutes.d.ts
    (4,69): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'CreateHistory'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\routerHistory.d.ts
    (10,46): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\routerHistory.d.ts
    (20,39): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryQueries'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Redirect.d.ts
    (14,19): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\IndexRedirect.d.ts
    (12,16): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (4,5): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'QueryString'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (4,18): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (112,56): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index".History' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (113,56): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index".History' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\history\index.d.ts
    (5,21): error TS2300: Duplicate identifier 'History'.

    ERROR in z:\projects\temp\ReactRedux\ClientApp\boot-server.tsx
    (5,33): error TS2307: Cannot find module 'history/lib/createMemoryHistory'.

    ERROR in ./ClientApp/boot-client.tsx
    (21,17): error TS2322: Type 'ReactRouterReduxHistory' is not assignable to type 'History'.

    ERROR in ./ClientApp/boot-client.tsx
    (21,17): error TS2322: Type 'ReactRouterReduxHistory' is not assignable to type 'History'.
      Property 'length' is missing in type 'ReactRouterReduxHistory'.
    Child extract-text-webpack-plugin:
            + 2 hidden modules
Child
    Hash: 59f70807ccc31b057bb8
    Version: webpack 1.14.0
    Time: 3991ms
             Asset     Size  Chunks             Chunk Names
    main-server.js  86.3 kB       0  [emitted]  main-server
        + 21 hidden modules

    ERROR in Z:\projects\temp\ReactRedux\node_modules\typescript\lib\lib.dom.d.ts
    (7552,11): error TS2300: Duplicate identifier 'History'.

    ERROR in Z:\projects\temp\ReactRedux\node_modules\typescript\lib\lib.dom.d.ts
    (7562,13): error TS2300: Duplicate identifier 'History'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router-redux\node_modules\@types\history\index.d.ts
    (6,21): error TS2300: Duplicate identifier 'History'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\createMemoryHistory.d.ts
    (3,57): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryOptions'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRouterHistory.d.ts
    (1,19): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryOptions'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRouterHistory.d.ts
    (1,35): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryQueries'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRouterHistory.d.ts
    (1,51): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'CreateHistory'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRoutes.d.ts
    (4,48): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'CreateHistory'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\useRoutes.d.ts
    (4,69): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'CreateHistory'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\routerHistory.d.ts
    (10,46): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\routerHistory.d.ts
    (20,39): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'HistoryQueries'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Redirect.d.ts
    (14,19): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\IndexRedirect.d.ts
    (12,16): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (4,5): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'QueryString'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (4,18): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index"' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (112,56): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index".History' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\react-router\lib\Router.d.ts
    (113,56): error TS2305: Module '"z:/projects/temp/ReactRedux/node_modules/@types/history/index".History' has no exported member 'Query'.

    ERROR in z:\projects\temp\ReactRedux\node_modules\@types\history\index.d.ts
    (5,21): error TS2300: Duplicate identifier 'History'.

    ERROR in ./ClientApp/boot-server.tsx
    (5,33): error TS2307: Cannot find module 'history/lib/createMemoryHistory'.

    ERROR in z:\projects\temp\ReactRedux\ClientApp\boot-client.tsx
    (21,17): error TS2322: Type 'ReactRouterReduxHistory' is not assignable to type 'History'.

    ERROR in z:\projects\temp\ReactRedux\ClientApp\boot-client.tsx
    (21,17): error TS2322: Type 'ReactRouterReduxHistory' is not assignable to type 'History'.
      Property 'length' is missing in type 'ReactRouterReduxHistory'.

Activity

  1. baserz commented on Jan 13, 2017

    @baserz

    No thats not normal and i noticed it as well today when generating a new template after having updated yo & aspnetcore-spa generator.

    I tried copying my old node_modules from a week old project (same package file), replacing the ones downloaded in the new project and the errors disappeared.

  2. SapientGuardian commented on Jan 15, 2017

    @SapientGuardian

    I've also run into this. I had to make the following adjustments to my package.json to get things working again:

        "@types/react-router": "2.0.42",
        "@types/react-router-redux": "4.0.36",
        "@types/history": "2.0.44",
    
  3. MarkPieszak commented on Jan 15, 2017

    @MarkPieszak
    Contributor

    I'm looking into it now, previously react-router-redux had some typings issues in it's declaration files. DefinitelyTyped/DefinitelyTyped#10686 (comment), which then the fixes got merged in DefinitelyTyped/DefinitelyTyped#13642 a few days ago.

    The template is using "@types/react-router-redux": "^4.0.30", with ^ so it picks up the latest version.

    So the History (@types/history) definition files had some serious updates recently: you can see them in this commit, DefinitelyTyped/DefinitelyTyped@a1abf4f

    So although the react-redux-router types fixes would have helped, the 2 are now colliding.

    @SapientGuardian is correct in that the types should be pinned for now.

    Just made a PR for it here #586

  4. davetemplin commented on Jan 15, 2017

    @davetemplin

    Hmm, just wondering if the the problem is in @types/react-router-redux or @types/react-router?

    $ npm install @types/react-router-redux
    `-- @types/react-router-redux@4.0.38
      +-- @types/history@2.0.45
      +-- @types/react-router@2.0.44
      | `-- @types/react@15.0.0
      `-- redux@3.6.0
        +-- lodash@4.17.4
        +-- lodash-es@4.17.4
        +-- loose-envify@1.3.1
        | `-- js-tokens@3.0.0
        `-- symbol-observable@1.0.4
    

    ...got @types/history@2.0.45 as expected

    $ npm install @types/react-router
    `-- @types/react-router@2.0.44
      +-- @types/history@4.5.0
      `-- @types/react@15.0.0
    

    ...got @types/history@4.5.0, expected @types/history@2.0.45

    Also noticed the following in the package.json for @types/react-router...

      "version": "2.0.44",
      "dependencies":
      {
        "@types/history": "*",
        "@types/react": "*"
      }, ...

    Could another way to fix be to set "@types/history": "~2.0.44" instead?
    Where are these dependent versions set for @types?

  5. olafurw commented on Jan 15, 2017

    @olafurw

    Yup I have the same issue, seems to be installing version 4.x.x, fixed temporarily on my end by adding

    "@types/history": "^2.0.44"

    to my own dependency list.

  6. SteveSandersonMS commented on Jan 16, 2017

    @SteveSandersonMS
    Member

    Thanks for reporting this. Fixed in f8714e9.

  7. aleksfront commented on Jan 16, 2017

    @aleksfront

    @olafurw Thanks!

  8. olafurw commented on Jan 16, 2017

    @olafurw

    Anytime Chuck Norris.

  9. mcquiggd commented on Jan 16, 2017

    @mcquiggd

    @SteveSandersonMS

    Quick question - will the published Yo generator be updated shortly with this fix, or do I have to be a bit more patient? ;) (Updated my copy just now but problem persists).

    Edit:

    Just copied the changed files from your commit f8714e9 into the relevant locations (on windows):

    C:\Users\{Username}\AppData\Roaming\npm\node_modules\generator-aspnetcore-spa\app\templates\

    All working - very happy 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions