2016-05-12 6 views
1

Typescript react-reduxアプリケーションでreact-datagridを使用しようとしています。私が反応し、データグリッドを推奨するようにインストールされているが、私はbrowser.jsモジュールを複製するために関連する奇妙なWebPACKのメッセージを取得しています:レスポンスデータグリッドを使用している場合、Webpackは同じ名前のブラウザbrowser.jsを報告します

import * as React from "react"; 

import DataGrid from 'react-datagrid' 

export const NodeList = (props) => (
    <div id="NodeList"> 
     <h2>{props.heading}</h2> 
     <DataGrid idProperty="id" dataSource={props.items}/> 
    </div> 
    ) 
:ここ

WARNING in (webpack)/~/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 (webpack)/~/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. 

ERROR in /users/simonshapiro/reactexp/src/components/NodeList.tsx 
(3,22): error TS2307: Cannot find module 'react-datagrid'. 

ERROR in (webpack)/~/node-libs-browser/~/buffer/index.js 
Module not found: Error: Cannot resolve module 'source-map-loader' in /usr/local/lib/node_modules/webpack/node_modules/node-libs-browser/node_modules/buffer 
@ (webpack)/~/node-libs-browser/~/buffer/index.js 1:0-106 

ERROR in (webpack)/~/node-libs-browser/~/buffer/index.js 
Module not found: Error: Cannot resolve module 'source-map-loader' in /usr/local/lib/node_modules/webpack/node_modules/node-libs-browser/node_modules/buffer 
@ (webpack)/~/node-libs-browser/~/buffer/index.js 12:14-32 

ERROR in (webpack)/~/node-libs-browser/~/buffer/index.js 
Module not found: Error: Cannot resolve module 'source-map-loader' in /usr/local/lib/node_modules/webpack/node_modules/node-libs-browser/node_modules/buffer 
@ (webpack)/~/node-libs-browser/~/buffer/index.js 13:14-32 

ERROR in (webpack)/~/node-libs-browser/~/buffer/index.js 
Module not found: Error: Cannot resolve module 'source-map-loader' in /usr/local/lib/node_modules/webpack/node_modules/node-libs-browser/node_modules/buffer 
@ (webpack)/~/node-libs-browser/~/buffer/index.js 11:13-33 

が反応し、データグリッドを使用して活字体ファイルNodeList.tsxです

とts.configファイル:

{ 
    "compilerOptions": { 
     "outDir": "./dist/", 
     "sourceMap": true, 
     "noImplicitAny": false, 
     "module": "commonjs", 
     "target": "es5", 
     "jsx": "react" 
    }, 
    "files": [ 
     "./typings/main.d.ts", 
     "./src/infomodel/InfoModel.ts", 
     "./src/components/Hello.tsx", 
     "./src/containers/TextContainer.ts", 
     "./src/containers/NodeListContainer.ts", 
     "./src/index.tsx", 
     "./src/reducers/AppLogic.ts" 
    ] 
} 

とWebPACKの設定ファイル:

module.exports = { 
    entry: "./src/index.tsx", 
    output: { 
     filename: "./dist/bundle.js", 
    }, 

    // Enable sourcemaps for debugging webpack's output. 
    devtool: "source-map", 

    resolve: { 
     // Add '.ts' and '.tsx' as resolvable extensions. 
     extensions: ["", ".webpack.js", ".web.js", ".ts", ".tsx", ".js"] 
    }, 

    module: { 
     loaders: [ 
      // All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'. 
      { test: /\.tsx?$/, loader: "ts-loader" } 
     ], 

     preLoaders: [ 
      // All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. 
      { test: /\.js$/, loader: "source-map-loader" } 
     ] 
    }, 

    // When importing a module whose path matches one of the following, just 
    // assume a corresponding global variable exists and use that instead. 
    // This is important because it allows us to avoid bundling all of our 
    // dependencies, which allows browsers to cache those libraries between builds. 
    externals: { 
     "react": "React", 
     "react-dom": "ReactDOM" 
    }, 
}; 

これは、反応データグリッドGithub発行のログからクロスポストされています。

答えて

0

tsアプリケーションに新しい依存関係をインストールするときは、プロジェクト構成に応じてtsd install(または入力用インストール)を実行する必要があります。それでも解決しない場合は、package.jsonを投稿してください。

関連する問題