ericz1803 / react-google-calendar

React Calendar Component that displays data from Google Calendar
https://ericz1803.github.io/react-test-calendar
MIT License
176 stars 63 forks source link

Getting a warning about importing 'trace' and Calendar import not working with next.js and typescript #59

Closed HagOrMan closed 10 months ago

HagOrMan commented 11 months ago

I've installed @ericz1803/react-google-calendar through yarn.

Importing with import Calendar from "@ericz1803/react-google-calendar"; gives the warning JSX element type 'Calendar' does not have any construct or call signatures. However, the code still runs fine. const Calendar = require('@ericz1803/react-google-calendar'); gives no warning, and also runs fine. Is there any known errors when using Calendar with next.js and typescript?

Furthermore, when I run the code, this warning message appears for both the above import scenarios:

- warn ./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js
Module not found: Can't resolve './locale' in 'C:\Users\user\OneDrive\Documents\GitHub\Project\node_modules\@ericz1803\react-google-calendar\dist'   

Import trace for requested module:
./node_modules/@ericz1803/react-google-calendar/dist/react-google-calendar.es.js

Any idea why it is asking for trace, or how to fix it?

ericz1803 commented 11 months ago

Yeah I've seen the Module not found: Can't resolve './locale' in 'C:\Users\user\OneDrive\Documents\GitHub\Project\node_modules\@ericz1803\react-google-calendar\dist' warning before. It seems to be something that other people have experienced using moment-js and moment-timezone but I don't know what's causing it and it also doesn't seem to be causing any issues with functionality so I'd say its ok to ignore. Let me know if it ends up causing issues though.

HagOrMan commented 10 months ago

Got it okay, thanks for letting me know!