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

@mui/x-date-pickers v 7.17 cause "Attempted import error: 'validateDate' is not exported from '@mui/x-date-pickers/internals'" #310

Closed
2 tasks done
Skarvion opened this issue Sep 16, 2024 · 4 comments · Fixed by #319

Comments

@Skarvion
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

In a NextJS project, when using the latest @mui/x-date-pickers package v 7.17 and then build, the following warning message is raised

Attempted import error: 'validateDate' is not exported from '@mui/x-date-pickers/internals'

Honestly, I don't know what the actual impact when testing it, but the warning message is a bit concerning whereas last week it wasn't there.

See mui/mui-x#14486 that moves the validateDate export from @mui/x-date-pickers/internals to @mui/x-date-pickers/validation

I suppose an easy fix is to use the new import path, but since that PR introduces a new validation hook, I'll leave it up to your discretion how to fix import issue.

For now, to avoid the error, I can use older version of @mui/x-date-pickers

Expected behavior 🤔

Steps to reproduce 🕹

Steps:

  1. Create a NextJS project (probably can use vanilla React project, but I haven't test)
  2. Install @mui/x-date-pickers@7.17.0
  3. Add <DatePickerElement>
  4. Build
  5. Warning message in console
@sadik-malik
Copy link
Contributor

@Skarvion <DatePickerElement> uses the validateDate function internally to perform date-related validation. MUI, in this commit, has changed the import path for validateDate from @mui/x-date-pickers/internals to @mui/x-date-pickers/validation.

@dohomi, this change will not be backward compatible if we implement it.

@dohomi
Copy link
Owner

dohomi commented Sep 17, 2024

Ok thanks for pointing this out.

@jesade-vbg
Copy link

Hi! Any workaround?

@Skarvion
Copy link
Author

Skarvion commented Oct 8, 2024

Hi! Any workaround?

npm install @mui/x-date-pickers@7.16.0

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