-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] AdapterDayjs Module not found #8849
Comments
Hello, have you tried importing directly from Suggestion: Consider dropping |
Thank you for the suggestion! Tried doing that and I only installed the |
Could you please provide a code snippet or a "codesandbox" demo with the code that is causing issues? |
Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information. |
From @LukasTy import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' node:internal/process/esm_loader:40 2nd Attempt: import pkg from '@mui/x-date-pickers/AdapterDayjs/index.js';
Node.js v20.10.0 Both tried Node 20 and 18 has still the same issue. 3rd Attempt: X [ERROR] No matching export in "node_modules/@mui/x-date-pickers/AdapterDayjs/index.js" for import "default"
Can anybody help? |
Could you please provide a reproduction example or at least the import you are using and the version of the package? |
@IvanAlcuinoAxpara This looks like an environment setup issue.
|
Yap I did both but still having the same issue. I updated my original post. |
@IvanAlcuinoAxpara I've setup a fresh Remix project with the default recommended template, installed |
@IvanAlcuinoAxpara, @LukasTy, this is my problem (and possible solution for your problem). It can be solved by importing from |
@shish-ko Could you please provide a reproduction example or repository for us to test? 🤔 |
@LukasTy https://github.com/shish-ko/mui_vite |
i couldn't import DayCalendarSkeleton if i import it will error shows export 'DayCalendarSkeleton' (imported as 'DayCalendarSkeleton') was not found in '@mui/x-date-pickers' |
// with date-fns v2.x
|
@LukasTy Hi! Is there any updates? |
Sorry, I didn't have the chance to look at it yet. |
I finally managed to get this working. Essentially, what I did was implement lazy loading for this particular component. To elaborate, there's a component named DateTimeInput.tsx that utilizes these adapters. The initial import lines resemble the following: import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
export default function DateTimeInput(){
return //... your code here
} Subsequently, there's another component, Instead of directly importing // this code does not work
import { DateTimeInput } from 'src/component/input/DateTimeInput';
function Form() {
return <>
<DateTimeInput />
</>
} I changed it to // this will work
import { Suspense, lazy, useState } from 'react';
const DateTimeInput = lazy(() => import(`~/src/component/input/DateTimeInput`));
function Form() {
return <Suspense>
<DateTimeInput />
</Suspense>
} |
Hello if you use quickly delete the cache vite in the node module |
I encountered the same issue when trying to use the Luxon Adapter. import { vitePlugin as remix } from '@remix-run/dev';
import { installGlobals } from '@remix-run/node';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import path from 'path';
installGlobals();
export default defineConfig({
plugins: [
remix({
ssr: false,
}),
tsconfigPaths(),
],
resolve: {
alias: {
'@mui/x-date-pickers/AdapterLuxon': path.resolve(
__dirname,
'node_modules/@mui/x-date-pickers/AdapterLuxon/AdapterLuxon.js',
),
},
},
optimizeDeps: {
include: [
'@mui/material',
'@mui/icons-material',
'@emotion/react',
'@emotion/styled',
],
force: true,
},
}); |
install
|
For DayJs, I exacyly followed @yukiyokotani solution and it worked. Thanks! export default defineConfig({
//...
resolve: {
alias: {
"@mui/x-date-pickers/AdapterDayjs": path.resolve(
__dirname,
"node_modules/@mui/x-date-pickers/AdapterDayjs/AdapterDayjs.js"
),
},
},
//...
});
|
Duplicates
Latest version
Current behavior 😯
Error on compile, AdapterDayjs module not found, causing breaking issues.
Context 🔦
Been having trouble with this module every time I compile. AdapterDayjs is not exported from the
@mui/x-date-pickers
module, even though its been imported. Tried searching up the issue and thought it might be an issue with dependency but I'm not entirely sure how to check whether I need to upgrade or downgrade anything. Tried uninstalling and reinstallingx-date-pickers
I get an import error:
Which then causes an issue in exporting the module:
For context, these are my dependencies:
The text was updated successfully, but these errors were encountered: