{"action":"opened","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/24788","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/24788/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/24788/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/24788/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24788","id":312181270,"number":24788,"title":"Cannot find module 'csstype'","user":{"login":"liketurbo","id":29164042,"avatar_url":"https://avatars2.githubusercontent.com/u/29164042?v=4","gravatar_id":"","url":"https://api.github.com/users/liketurbo","html_url":"https://github.com/liketurbo","followers_url":"https://api.github.com/users/liketurbo/followers","following_url":"https://api.github.com/users/liketurbo/following{/other_user}","gists_url":"https://api.github.com/users/liketurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/liketurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liketurbo/subscriptions","organizations_url":"https://api.github.com/users/liketurbo/orgs","repos_url":"https://api.github.com/users/liketurbo/repos","events_url":"https://api.github.com/users/liketurbo/events{/privacy}","received_events_url":"https://api.github.com/users/liketurbo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-07T07:30:40Z","updated_at":"2018-04-07T07:30:40Z","closed_at":null,"author_association":"NONE","body":"Hi, I am trying use react with typescript, I installed (react, @types/react, react-dom, @types/react-dom), in attempt to launch project I get error `ERROR in [at-loader] ./node_modules/@types/react/index.d.ts:55:22` `Cannot find module 'csstype'`. I tried `npm i csstype` in @types/react, in root of project. In @types/react exists folder node_modules/csstype.\r\n\r\n***tsconfig.json***\r\n```\r\n{\r\n    \"compilerOptions\": {\r\n        \"outDir\": \"./build/\", // path to output directory\r\n        \"strictNullChecks\": true, // enable strict null checks as a best practice\r\n        \"module\": \"es6\", // specify module code generation\r\n        \"jsx\": \"react\", // use typescript to transpile jsx to js\r\n        \"target\": \"es5\", // specify ECMAScript target version\r\n        \"allowJs\": true, // allow a partial TypeScript and JavaScript codebase\r\n        \r\n        \"noImplicitAny\": true,\r\n        \"noImplicitReturns\": true,\r\n        \"noUnusedLocals\": true,\r\n        \"noUnusedParameters\": true,\r\n    },\r\n    \"exclude\": [\r\n        \"node_modules\"\r\n    ],\r\n    \"include\": [\r\n        \"./source/**/*.tsx\",\r\n        \"./source/**/*.ts\"\r\n    ]\r\n}\r\n```   \r\n***package.json***\r\n```\r\n{\r\n  \"name\": \"suggestion-app\",\r\n  \"version\": \"1.0.0\",\r\n  \"main\": \"index.js\",\r\n  \"license\": \"MIT\",\r\n  \"scripts\": {\r\n    \"webpack:server\": \"babel-node node_modules/.bin/webpack-dev-server --mode=development\"\r\n  },\r\n  \"dependencies\": {\r\n    \"csstype\": \"^2.1.1\",\r\n    \"react\": \"^16.3.1\",\r\n    \"react-dom\": \"^16.3.1\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"@types/react\": \"^16.3.5\",\r\n    \"@types/react-dom\": \"^16.0.4\",\r\n    \"awesome-typescript-loader\": \"^5.0.0\",\r\n    \"babel-cli\": \"^6.26.0\",\r\n    \"babel-preset-env\": \"^1.6.1\",\r\n    \"babel-preset-stage-3\": \"^6.24.1\",\r\n    \"caniuse-lite\": \"^1.0.30000697\",\r\n    \"clean-webpack-plugin\": \"^0.1.19\",\r\n    \"css-loader\": \"^0.28.11\",\r\n    \"file-loader\": \"^1.1.11\",\r\n    \"glob\": \"^7.1.2\",\r\n    \"html-webpack-plugin\": \"^3.2.0\",\r\n    \"mini-css-extract-plugin\": \"^0.4.0\",\r\n    \"postcss-cssnext\": \"^3.1.0\",\r\n    \"postcss-loader\": \"^2.1.3\",\r\n    \"purify-css\": \"^1.2.5\",\r\n    \"purifycss-webpack\": \"^0.7.0\",\r\n    \"script-ext-html-webpack-plugin\": \"^2.0.1\",\r\n    \"tslint\": \"^5.9.1\",\r\n    \"tslint-config-prettier\": \"^1.10.0\",\r\n    \"typescript\": \"^2.8.1\",\r\n    \"webpack\": \"^4.5.0\",\r\n    \"webpack-cli\": \"^2.0.14\",\r\n    \"webpack-dev-server\": \"^3.1.1\"\r\n  }\r\n}\r\n```\r\n**webpack.config.js**\r\n```\r\nimport path from 'path';\r\nimport glob from 'glob';\r\n\r\nimport MiniCssExtractPlugin from 'mini-css-extract-plugin';\r\nimport PurifyCSSPlugin from 'purifycss-webpack';\r\nimport CleanWebpackPlugin from 'clean-webpack-plugin';\r\nimport HtmlWebpackPlugin from 'html-webpack-plugin';\r\nimport ScriptExtHtmlWebpackPlugin from 'script-ext-html-webpack-plugin';\r\n\r\nconst inProduction = process.argv[process.argv.length - 1]\r\n  .match(/[a-z]+$/g)[0] === 'production';\r\n\r\nconst basics = {\r\n  entry: {\r\n    app: path.join(__dirname, 'source/index.tsx'),\r\n  },\r\n  output: {\r\n    path: path.join(__dirname, 'build'),\r\n    filename: '[name].[chunkhash].js',\r\n  },\r\n};\r\n\r\nconst rules = [\r\n  {\r\n    test: /\\.ico$/,\r\n    loader: 'file-loader',\r\n    options: { name: '[name].[ext]' },\r\n  },\r\n  {\r\n    test: /\\.(png|jpe?g|gif|svg|eot|ttf|woff|woff2)$/,\r\n    loader: 'file-loader',\r\n    options: { name: 'assets/[name].[ext]' },\r\n  },\r\n  {\r\n    test: /\\.css$/,\r\n    use: [\r\n      MiniCssExtractPlugin.loader,\r\n      'css-loader',\r\n      'postcss-loader',\r\n    ],\r\n  },\r\n  { \r\n    test: /\\.(t|j)sx?$/, \r\n    use: {\r\n       loader: 'awesome-typescript-loader',\r\n    }, \r\n  },\r\n];\r\n\r\nconst plugins = [\r\n  new MiniCssExtractPlugin({\r\n    filename: \"[name].[contenthash].css\",\r\n  }),\r\n  new CleanWebpackPlugin('build'),\r\n  new HtmlWebpackPlugin({\r\n    template: path.join(__dirname, 'public/index.html'),\r\n  }),\r\n  new ScriptExtHtmlWebpackPlugin({\r\n    defaultAttribute: 'async',\r\n  }),\r\n  new PurifyCSSPlugin({\r\n    paths: glob.sync(path.join(__dirname, 'public/index.html')),\r\n    minimize: inProduction,\r\n  }),\r\n];\r\n\r\nexport default {\r\n  ...basics, module: { rules }, plugins,\r\n};\r\n```\r\n"}}
{"actor":{"display_login":"liketurbo"}}