Closed ayxos closed 3 years ago
@ayxos precss and postcss are dev dependencies and they shouldn't be installed when installing the package from npm. Where do you get this error?
On my terminal when I run my project with the latest react-date-range version. The program was not able to compile
I have the same issue in v1.0.3 and v1.1.3 using node v12
@burakcan
ERROR in ../node_modules/react-date-range/dist/styles.css (../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[3]!../node_modules/react-date-range/dist/styles.css)
Module build failed (from ../node_modules/postcss-loader/dist/cjs.js):
Error: Cannot find module 'precss'
Require stack:
- /Users/user/projects/dashboard-2.0/node_modules/react-date-range/postcss.config.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/node_modules/cosmiconfig/dist/loaders.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/node_modules/cosmiconfig/dist/ExplorerBase.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/node_modules/cosmiconfig/dist/Explorer.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/node_modules/cosmiconfig/dist/index.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/dist/utils.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/dist/index.js
- /Users/user/projects/dashboard-2.0/node_modules/postcss-loader/dist/cjs.js
- /Users/user/projects/dashboard-2.0/node_modules/loader-runner/lib/loadLoader.js
- /Users/user/projects/dashboard-2.0/node_modules/loader-runner/lib/LoaderRunner.js
- /Users/user/projects/dashboard-2.0/node_modules/webpack/lib/NormalModule.js
- /Users/user/projects/dashboard-2.0/node_modules/webpack/lib/LoaderTargetPlugin.js
- /Users/user/projects/dashboard-2.0/node_modules/html-webpack-plugin/lib/child-compiler.js
- /Users/user/projects/dashboard-2.0/node_modules/html-webpack-plugin/lib/cached-child-compiler.js
- /Users/user/projects/dashboard-2.0/node_modules/html-webpack-plugin/index.js
- /Users/user/projects/dashboard-2.0/config/webpack.config.dev.js
- /Users/user/projects/dashboard-2.0/tools/start.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1080:15)
at Function.Module._load (internal/modules/cjs/loader.js:923:27)
at Module.require (internal/modules/cjs/loader.js:1140:19)
at require (internal/modules/cjs/helpers.js:75:18)
at Object.<anonymous> (/Users/user/projects/dashboard-2.0/node_modules/react-date-range/postcss.config.js:1:16)
at Module._compile (internal/modules/cjs/loader.js:1251:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
at Module.load (internal/modules/cjs/loader.js:1100:32)
at Function.Module._load (internal/modules/cjs/loader.js:962:14)
at Module.require (internal/modules/cjs/loader.js:1140:19)
@ ../node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].use[1]!../node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].use[2]!../node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].use[3]!./styles/main.scss 5:0-317 10:26-59
@ ./styles/main.scss 47:4-60:5 2:12-263 9:17-24 13:7-21 45:20-34 49:6-59:7 50:38-52 56:26-40 58:21-28 68:15-29
@ ./app/index.jsx 1:2139-2167
Why v1.1.3 package includes postcss.config.js?
any news? it's happening with me too
Same here... Any updates?
I submitted #472 which should solve this.
We are using the following workaround at the moment, by specifying the path to your postcss config file instead of relying on postcss config detection (like described here):
{
test: /\.css$/,
include: /node_modules/,
use: [
require.resolve('style-loader'),
require.resolve('css-loader'),
{
loader: require.resolve('postcss-loader'),
// FIXME: https://github.com/hypeserver/react-date-range/pull/472
options: { postcssOptions: { config: path.resolve(__dirname, 'postcss.config.js') } },
},
],
},
This has been release as 1.1.4 Please give it a try and let us know if there is any concerns. :)
Subject of the issue
'Cannot find module precss' 'Cannot find module postcss-import'
[BUG] Bug Reproduce Steps
update react-date-range to latest version (1.1.3)
[BUG] Expected behaviour
Why are them not automatically installed as a third party dep from the package itself?
Environment
Package Version: ^1.1.3 Node version: 14.5.0