Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install third-party deps on 1.1.3 version #417

Closed
ayxos opened this issue Oct 14, 2020 · 9 comments
Closed

Cannot install third-party deps on 1.1.3 version #417

ayxos opened this issue Oct 14, 2020 · 9 comments

Comments

@ayxos
Copy link

ayxos commented Oct 14, 2020

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

@burakcan
Copy link
Collaborator

@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?

@ayxos
Copy link
Author

ayxos commented Oct 14, 2020

On my terminal when I run my project with the latest react-date-range version. The program was not able to compile

@fexblanco
Copy link

I have the same issue in v1.0.3 and v1.1.3 using node v12

@ayxos
Copy link
Author

ayxos commented Oct 26, 2020

@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

@lightyen
Copy link

lightyen commented Nov 3, 2020

Why v1.1.3 package includes postcss.config.js?

@jaimeneto85
Copy link

any news? it's happening with me too

@matheuscorrea
Copy link

Same here... Any updates?

@nikolaik
Copy link
Collaborator

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') } },
   },
 ],
},

@kamyar kamyar closed this as completed in 2626f36 May 29, 2021
@kamyar
Copy link
Contributor

kamyar commented May 30, 2021

This has been release as 1.1.4
Please give it a try and let us know if there is any concerns. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants