react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Module not found: Can't resolve 'react-datepicker/dist/react-datepicker.css' in v2.9.0

Open hiredgun opened this issue 7 years ago • 32 comments

Describe the bug Looks like the package folder is missing dist folder after 2.9.0 release causing webpack build to fail due to the missing 'react-datepicker/dist/react-datepicker.css' file

image

To Reproduce Steps to reproduce the behavior:

Install 2.9.0 version and import 'react-datepicker/dist/react-datepicker.css' file in one of your components

Desktop (please complete the following information):

  • OS: Mac

Additional context Node: 12.9.0 NPM: 6.10.2

hiredgun avatar Aug 29 '19 10:08 hiredgun

same here

thitoo avatar Aug 29 '19 10:08 thitoo

~~Major issue for us atm.~~ *We are locking to previous.

srMarquinho avatar Aug 29 '19 10:08 srMarquinho

@mxschmitt Any idea what went wrong here. This might be caused by the refactoring of the release process.

martijnrusschen avatar Aug 29 '19 10:08 martijnrusschen

@mxschmitt Any idea what went wrong here. This might be caused by the refactoring of the release process.

I guess it it's because of my refactoring. I will investigate now

mxschmitt avatar Aug 29 '19 10:08 mxschmitt

I'm observing the same issue on @2.0.0 also. I managed to get rid of the problem locally with npm install style-loader css-loader --save but I still have this issue on Circle CI as

yarn run v1.17.3
$ react-scripts build
Creating an optimized production build...
Failed to compile.

Module not found: Error: Can't resolve 'react-datepicker/dist/react-datepicker.css' ...

peterpribylina avatar Aug 29 '19 11:08 peterpribylina

same problem on @2.1.0. Hopefully you guys can resolve this)

JohnLyonJunior avatar Aug 29 '19 11:08 JohnLyonJunior

same problem here, any fix or workaround that you could recommend? Major issue in our deployment now. I’ll try to use @2.9.0 or the previous version for now

junmich avatar Aug 29 '19 12:08 junmich

same problem, I am facing the same issue in our deployment

NwogeEberechi avatar Aug 29 '19 12:08 NwogeEberechi

Same problem

vitalbadjo avatar Aug 29 '19 12:08 vitalbadjo

same problem

ni3k avatar Aug 29 '19 12:08 ni3k

I created here a Pr, should fix the build process: https://github.com/Hacker0x01/react-datepicker/pull/1883

But I'm sorry, I don't have much rollup knowledge :/

mxschmitt avatar Aug 29 '19 13:08 mxschmitt

Thank you for the patch v2.9.1 @mxschmitt , but it doesn't seem to work for me neither Same error. dist folder is created but remains empty.

peterpribylina avatar Aug 29 '19 13:08 peterpribylina

Can you try this again with v2.9.3?

martijnrusschen avatar Aug 29 '19 14:08 martijnrusschen

Thx @martijnrusschen ! All working now 💯

peterpribylina avatar Aug 29 '19 14:08 peterpribylina

Fixed by 98fa95162b51ac523da37c8de66fae05d64ef717. Thanks all!

martijnrusschen avatar Aug 29 '19 14:08 martijnrusschen

This package use to work in meteor.js. I install it using: meteor npm install --save react-datepicker But now I get an error that references react-datepicker.css, here it is:

`/home/2in/Meteor1.6/meteor10-Hydrate/Atrade/node_modules/react-datepicker/dist/react-datepicker.css:1 (function (exports, require, module, __filename, __dirname) { .react-datepicker-popper[data-placement^="bottom"] .react-datepicker__triangle, .react-datepicker-popper[data-placement^="top"] .react-datepicker__triangle, .react-datepicker__year-read-view--down-arrow, ^

SyntaxError: Unexpected token . at createScript (vm.js:80:10) at Object.runInThisContext (vm.js:139:10) at Module._compile (module.js:616:28) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at npmRequire (/home/2in/Meteor1.6/meteor10-Hydrate/Atrade/.meteor/local/build/programs/server/npm-require.js:133:10) at Module.useNode (packages/modules-runtime.js:664:18) at react-datepicker.css (packages/modules.js:433:8) at fileEvaluate (packages/modules-runtime.js:336:7) at Module.require (packages/modules-runtime.js:238:14) at Module.moduleLink [as link] (/home/2in/.meteor/packages/modules/.0.13.0.ibssab.6e4t++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38) at SearchPurchaseHistory.jsx (imports/ui/components/SearchPurchaseHistory.jsx:1:226) at fileEvaluate (packages/modules-runtime.js:336:7) at Module.require (packages/modules-runtime.js:238:14) at Module.moduleLink [as link] (/home/2in/.meteor/packages/modules/.0.13.0.ibssab.6e4t++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/reify/lib/runtime/index.js:38:38) at router.jsx (imports/ui/router.jsx:1:8256) at fileEvaluate (packages/modules-runtime.js:336:7) at Module.require (packages/modules-runtime.js:238:14) Exited with code: 1 Your application is crashing. Waiting for file change.`

Any ideas? Is this a bug? Is there a react and meteor specific datepicker I can use if this can't be resolved?

flameuzumo avatar Sep 10 '19 10:09 flameuzumo

getting this error on v2.10.1

izaakf avatar Dec 02 '19 18:12 izaakf

getting the same error on v2.14.1. Any solutions?

sommesh avatar May 02 '20 08:05 sommesh

@sommesh i never came across a stable solution so I moved to a different package unfortunately

izaakf avatar May 02 '20 12:05 izaakf

Okay, kindly let me know does that different package has accessibility support?

Anyway, I did a workaround to fix this. Just moved the file node_modules/react-datepicker/dist/react-datepicker.css to my local src folder and imported it.

sommesh avatar May 02 '20 13:05 sommesh