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

[pickers] Export of parseNonNullablePickerDate is missing #5916

Closed
2 tasks done
HakobSargsyan opened this issue Aug 26, 2022 · 12 comments · Fixed by #5941
Closed
2 tasks done

[pickers] Export of parseNonNullablePickerDate is missing #5916

HakobSargsyan opened this issue Aug 26, 2022 · 12 comments · Fixed by #5941
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module!

Comments

@HakobSargsyan
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

When I used [5.0.0-beta.7] version , I got the import parseNonNullablePickerDate error , because it was called from /node_modules/@mui/x-date-pickers-pro/DateRangePicker/shared.js , but not exported in the index.js

Expected behavior 🤔

it should work

Steps to reproduce 🕹

import { LocalizationProvider } from '@mui/x-date-pickers-pro';
import { DateRangePicker } from '@mui/x-date-pickers-pro/DateRangePicker';

and use it with 5.0.0-beta.7 version

Context 🔦

No response

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Order ID 💳 (optional)

No response

@HakobSargsyan HakobSargsyan added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 26, 2022
@LukasTy
Copy link
Member

LukasTy commented Aug 26, 2022

I've failed to reproduce the mentioned issue.
Could you provide a reproduction sample of the issue?
You can use codesandbox example as a base for it.

@LukasTy LukasTy added component: DateRangePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 26, 2022
@HakobSargsyan
Copy link
Author

HakobSargsyan commented Aug 26, 2022

I can't reproduce it there , I used Vite , you have these files

import {
  buildDeprecatedPropsWarning,
  BasePickerProps,
  PickerStateValueManager,
  useDefaultDates,
  useLocaleText,
  useUtils,
  ValidationProps,
  DefaultizedProps,
  **parseNonNullablePickerDate**,
  BaseDateValidationProps,
} from '@mui/x-date-pickers/internals';

and here in the @mui/x-date-pickers/internals/index.js

export { parseNonNullablePickerDate } from './utils/date-utils';. is missing

maybe problem here https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/internals/utils/date-utils.ts ?

in the beta.6 I saw you used export declare instead of export

@LukasTy

@LukasTy
Copy link
Member

LukasTy commented Aug 26, 2022

@HakobSargsyan I've created a working sandbox with latest pickers.
Could you try replicating your issue given it as a base?
The only issue I noticed was that date-fns was required alongside dayjs for the demo to work. I'll have a look at it.

@flaviendelangle
Copy link
Member

Would you happend to run different version of @mui/x-date-pickers and @mui/x-date-pickers-pro by any change ?
This method has been added recently so if you updated only the pro package it might cause the issue.

npx @mui/envinfo can easily give you this information.

@flaviendelangle flaviendelangle changed the title export of parseNonNullablePickerDate is missing [pickers] Export of parseNonNullablePickerDate is missing Aug 26, 2022
@flaviendelangle flaviendelangle added status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! labels Aug 26, 2022
@HakobSargsyan
Copy link
Author

HakobSargsyan commented Aug 26, 2022

@flaviendelangle no both was "@mui/x-date-pickers-pro": "^5.0.0-beta.7", and "@mui/x-date-pickers": "^5.0.0-beta.7", in the package.json

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Aug 26, 2022
@HakobSargsyan
Copy link
Author

HakobSargsyan commented Aug 26, 2022

@LukasTy https://codesandbox.io/s/vite-react-mui-forked-z8y0uh?file=/src/App.jsx

I remember this error, but I used AdapterLuxon , check sandbox example
luxon@2.5.0✘ [ERROR] Could not resolve "date-fns/locale/en-US"

node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils.js:2:26:
  2 │ import defaultLocale from 'date-fns/locale/en-US'; // @ts-ignore

You can mark the path "date-fns/locale/en-US" as external to exclude it from

@HakobSargsyan
Copy link
Author

I found this in the vite build
Screen Shot 2022-08-27 at 01 04 14

@flaviendelangle
Copy link
Member

node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils.js:2:26:

Oh for that one indeed I might have made a mistake instroducing date-fns in the default build from @mui/x-date-pickers-pro...
I'll fix it in the next release 👍

@HakobSargsyan
Copy link
Author

node_modules/@mui/x-date-pickers/internals/hooks/useField/useField.utils.js:2:26:

Oh for that one indeed I might have made a mistake instroducing date-fns in the default build from @mui/x-date-pickers-pro... I'll fix it in the next release 👍

Okay thanks @flaviendelangle , can it be related also wtih parseNonNullablePickerDate exception ?

@flaviendelangle
Copy link
Member

I am not familiar with Vite
Maybe it consider that the file is unsafe and ignores it, causing your problem

@LukasTy
Copy link
Member

LukasTy commented Aug 29, 2022

@HakobSargsyan I believe that it's just the difference in the error that is generated between builders.
I've checked that Flavians solution should fix the issue in Vite land as well. 😉
Consider using 5.0.0-beta.6 verion until this weeks release. 😉

@HakobSargsyan
Copy link
Author

@HakobSargsyan I believe that it's just the difference in the error that is generated between builders. I've checked that Flavians solution should fix the issue in Vite land as well. 😉 Consider using 5.0.0-beta.6 verion until this weeks release. 😉

Yes I am using 5.0.0-beta.6 now , thank you for the support , I will wait for the new release @LukasTy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants