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

Can't resolve 'material-ui-pickers/utils/MuiPickersUtilsProvider' #15

Closed
petersg83 opened this issue Oct 31, 2018 · 16 comments
Closed

Can't resolve 'material-ui-pickers/utils/MuiPickersUtilsProvider' #15

petersg83 opened this issue Oct 31, 2018 · 16 comments

Comments

@petersg83
Copy link

Hello,

I installed react-admin-dateinputs and I'm trying to use TimeInput but I have this error:
Module not found: Can't resolve 'material-ui-pickers/utils/MuiPickersUtilsProvider' in '/Users/pierre/Documents/schoolx/frontend/node_modules/react-admin-date-inputs/lib'

Here is my package.json:

{
"name": "schoolx-frontend",
"version": "0.1.0",
"private": true,
"dependencies": {
"import": "^0.0.6",
"jsonwebtoken": "^8.3.0",
"moment": "^2.22.2",
"ra-data-json-server": "^2.2.0",
"ra-language-english": "^2.2.0",
"ra-language-french": "^2.2.0",
"react": "^16.4.2",
"react-admin": "^2.4.0",
"react-admin-date-inputs": "^1.1.0",
"react-big-calendar": "^0.20.1",
"react-dom": "^16.4.2",
"react-router-dom": "^4.3.1",
"react-scripts": "1.1.4",
"recompose": "^0.28.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}

I tried to install the module material-ui-pickers but it didn't change anything.

Do you have an idea of how I can make it work ?
Thanks :)

@tmcgee
Copy link

tmcgee commented Nov 5, 2018

I am experiencing this as well. Likely related to the breaking changed noted in the material-ui-pickers version 1.0.0 release notes:

-import MuiPickersUtilsProvider from 'material-ui-pickers/utils/MuiPickersUtilsProvider'
+import MuiPickersUtilsProvider from 'material-ui-pickers/MuiPickersUtilsProvider'

@stephme
Copy link
Contributor

stephme commented Nov 6, 2018

#16 It worked for me. Thx @tmcgee

@kent10ou
Copy link

kent10ou commented Nov 8, 2018

Thanks! I think this is a similar issue, is this change published to npm yet? Which version of material-ui is everyone else using?

./node_modules/material-ui-pickers/utils/date-fns-utils/index.esm.js
Module not found: Can't resolve 'date-fns/addDays' in '~/Documents/<project>/node_modules/material-ui-pickers/utils/date-fns-utils'

@tmcgee
Copy link

tmcgee commented Nov 8, 2018

@kent10ou

This might be related to yet-another-release of material-ui-pickers. Version 2.0.0 this time. From the release notes:

We have moved our utils to the separate monorepo (star it here) and for now do

-import Utils from 'material-ui-pickers/utils/date-fns-utils'
+import Utils from '@date-io/date-fns'

Here is where I think the change should occur. I haven't had the opportunity to verify/fix locally.

Hope this helps.

@romainquellec
Copy link

@vascofg : Any plan to release a new version on npm ?

@marquesgabriel
Copy link

watching this thread

@vascofg
Copy link
Owner

vascofg commented Nov 27, 2018

Working on it now

@vascofg
Copy link
Owner

vascofg commented Nov 27, 2018

@kent10ou

This might be related to yet-another-release of material-ui-pickers. Version 2.0.0 this time. From the release notes:

We have moved our utils to the separate monorepo (star it here) and for now do

-import Utils from 'material-ui-pickers/utils/date-fns-utils'
+import Utils from '@date-io/date-fns'

Here is where I think the change should occur. I haven't had the opportunity to verify/fix locally.

Hope this helps.

Hey, unfortunately I won't be able to update to material-ui-pickers stable version since they decided to update to @material-ui/core@^3.2.0 and react-admin is still on @^1.4.0. This is causing some issues with the date-picker modal.

I'll try to publish a fixed version using the latest compatible material-ui-pickers version ASAP.

@vascofg
Copy link
Owner

vascofg commented Nov 27, 2018

Fixed in 1.0.21

@vascofg vascofg closed this as completed Nov 27, 2018
@astnerdev
Copy link

Hey @vascofg,
I have the same error message, but it's not solved in 1.0.21.

  "dependencies": {
    "@material-ui/core": "^3.2.0",
    "jwt-decode": "^2.2.0",
    "material-ui-chip-input": "^0.19.0",
    "ra-data-json-server": "^2.5.2",
    "ra-data-simple-rest": "^2.5.2",
    "react": "^16.7.0",
    "react-admin": "^2.4.0",
    "react-admin-date-inputs": "^1.0.21",
    "react-dom": "^16.7.0",
    "react-scripts": "2.1.2"
  }

Is the version 1.0.21 compatible with the current version of @material-ui/core 3.2.0 ?
Thanks

@charlesastaylor
Copy link

I'm getting very similar error message:

./node_modules/material-ui-pickers/utils/date-fns-utils.js`
`Module not found: Can't resolve 'date-fns/addDays' in '<project_dir>/node_modules/material-ui-pickers/utils'

with

"dependencies": {
    "ra-data-simple-rest": "^2.5.3",
    "react": "^16.7.0",
    "react-admin": "^2.5.3",
    "react-admin-date-inputs": "^1.0.21",
    "react-dom": "^16.7.0",
    "react-scripts": "2.1.3"
  }

@jacklj
Copy link

jacklj commented Jan 10, 2019

I'm getting the error too:

Module not found: Error: Can't resolve 'date-fns/addDays' in '/tmp/build_768d2570a4572a43a5b79af1cef23b51/admin/node_modules/material-ui-pickers/utils'

Upgrading to 1.0.21 didn't help.

Installing date-fns v2.0.0-alpha.7 manually did allow the app to build, but then I get weird visual bugs in the date picker, presumably due to breaking changes in version 2 of date-fns.

@despatates
Copy link

It seems error Can't resolve 'material-ui-pickers/utils/MuiPickersUtilsProvider' is back.
May it be linked to the upgrade of material-ui-pickers in PR #31?

@despatates
Copy link

An issue is open for this problem, see #37.

@x5engine
Copy link

anyway since the author is not here, here is a fix deployed to npm

https://github.com/x5engine/react-admin-date-inputs

npm install react-admin-date-inputs2 --save

@Julien-Sytadelle
Copy link

Just in case : If you still use react-admin v2.9, simply use the version 1.1.2 code you can easily find in commit history (1 file) and change the pickers import:
import { MuiPickersUtilsProvider, DatePicker, TimePicker, DateTimePicker } from 'material-ui-pickers';
/*
import DatePicker from 'material-ui-pickers';
import TimePicker from 'material-ui-pickers';
import DateTimePicker from 'material-ui-pickers';
*/

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