-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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] Can't start project using MUI and Remix + Vite. SyntaxError: Named export 'AdapterLuxon' not found. #12206
Comments
For me it does not start with the
@LukasTy could you try as well? |
@michelengelen Isn't it the same ESM problem as with all the |
It certainly does seem like it. 🤔 |
Thanks for looking at this @LukasTy and @michelengelen . I thought it might be related to the ESM problem, but thought it was weird that |
@tcov189 If I'm not mistaken, the setup of the |
Hmm I have never heard of that plugin. I will give that a whirl. |
@LukasTy Just tried using the vite-plugin-commonjs package, didn't seem to have any effect. I pushed that change up to my repro repo, maybe I am not configuring it properly? |
I confirm it's the same issue with AdapterDateFns and it's pretty annoying. Works in dev, do not in production with start cmd. |
But this seems to work : import { AdapterDayjs} from "@mui/x-date-pickers/node/AdapterDayjs"; |
Hmm that didn't work for me, I tried the import you provided and tried it using AdapterLuxon |
You need to remove the import commonjs from "vite-plugin-commonjs" from vite config |
Also change your import of ThemeProvider to : import { ThemeProvider } from '@mui/material'; And your import of blue should become : import { colors } from '@mui/material'; |
@raskyer This did it! I didn't realize there was even a Thanks for all the help! |
How did we do @tcov189? |
Steps to reproduce
When trying to start a Remix + Vite project and MUI's LocalizationProvider with AdapterLuxon I get a SyntaxError.
This same project works when running the project in dev mode and/or when using Remix's built in compiler.
Link to live example: https://github.com/tcov189/remix-vite-mui-issue
Steps:
npm run dev
and see project runsnpm run build
and see that there are no build errorsnpm run start
and see error in consoleCurrent behavior
Starting the project using
npm run start
results in the following error.Expected behavior
The project is able to start without errors.
Context
We are working on converting our CRA app to Remix + Vite.
We used this repo in order to get started and has been working using the Remix server.
As of v2.7, Remix now supports using Vite. When attempting to convert our app to use Vite, we start experiencing the error.
Your environment
npx @mui/envinfo
Search keywords: remix vite
Search keywords:
The text was updated successfully, but these errors were encountered: