-
Notifications
You must be signed in to change notification settings - Fork 110
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
React Vite compatibility #150
Comments
In my case even after adding that import it keeps giving me the Any news on this? |
Getting the same error. |
For everyone who is still getting this error, here is the fix import "@fullcalendar/react/dist/vdom";
import FullCalendar from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid"; |
@abdellatifLabr Still getting the same error :S |
@abdellatifLabr Bro did you manage to find the solution? |
@Maadtin the solution that worked for me is the one i posted above |
I'm running vite too and @abdellatifLabr's sequence above worked for me (using
(for benefit of others coming here via google) |
After spending a few hours on this, I now realize that @jugglingcats already pointed out the difference between the correct The latter imports from |
it works well, but why should i have to add this line in my code? import "@fullcalendar/react/dist/vdom"; if i don't import it, it will give me an error can u explain it? im curious about it |
See fullcalendar/fullcalendar#6371. With Vite, in the dev build, the pre-bundled fullcalendar dependency you import does not have the order fullcalendar expects. By importing that file manually from the fullcalendar dist folder, it will set the required globals before loading the pre-bundled fullcalendar bundle in your next import. |
thanks, an interesting problem |
Not sure if this is a fullcalendar issue or an astro issue, but when I added the
|
Thank you for answer. But Do you know how to fix order import for fullcalendar in pre-bundled Vite ? I have isssue about it. |
in vite Edit: some potential solutions here |
Same issue here. any plans on fixing it? |
It really Works! Thanks a lot!!! abdellatifLabr |
@adrianfabjanski do you use @vitejs/plugin-react ?
|
Yes I am using React with Vite and my file starts like that:
And than, the Component is something like that
|
Fixed in v6.0.0 The vdom import workaround is no longer necessary. |
you have right @arshaw in v6 no more is needed, just I remove de line |
DayTableView defines an invalid contextType. contextType should point to the Context object returned by React.createContext(). However, it is set to an object with keys {__c, __, Consumer, Provider}. I got this error when I use fullcalendar |
[plugin:vite:import-analysis] Missing "./dist/vdom" specifier in "@fullcalendar/react" package |
Hello,
Recently we've been researching a possibility to move our project to Vite environment. Of course we failed at the first try just because of the same issue as discussed in the Vue integration section of your repository (i.e. fullcalendar/fullcalendar-vue#152 and related). I've tried the solution provided there to import
@fullcalendar/core/vdom
just before anything else connected tofullcalendar
packages but it didn't work very well for a React project. The error I got was:The <CalendarDataProvider2 /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change CalendarDataProvider2 to extend React.Component instead.
and:
Uncaught TypeError: Cannot set property 'props' of undefined
.It definitely concerned the imported vdom not being compatible with Reacts vDOM. So I crawled through internal
fullcalendar
package files and I found@fullcalendar/react/dist/vdom
. When replacing the import the project seems to work.To sum up I would like to ask the project authors if the described solution is a proper way to run a React Fullcalendar project with a Vite build tool? If so, could the docs be updated (or should I prepare a PR to update them)?
The text was updated successfully, but these errors were encountered: