I have a React project served using Ruby on Rails 7. It's set up using this tutorial (source code available here); I'm at the part where you add React Router so you can add a second page to the app.
I ran yarn add @fullcalendar/react @fullcalendar/daygrid
and created a new component:
import React from 'react';
import FullCalendar from '@fullcalendar/react';
import dayGridPlugin from '@fullcalendar/daygrid';
const Hoard = () => {
return <div>
<FullCalendar
plugins={[ dayGridPlugin ]}
initialView="dayGridMonth"
/>
</div>
}
export default Hoard;
Then when I run ./bin/dev
and load the page, I get this error:
It seems that FullCalendar's CSS is somehow breaking Rails' asset pipeline. That doesn't make sense to me; FullCalendar doesn't have a file named application.css. Rails is creating app/assets/builds/application.css and then complaining that its filename conflicts with app/assets/stylesheets/application.css. This seems like a Rails problem instead of a FullCalendar problem, but it didn't come up until I added FullCalendar to the project. I can fix the problem by uninstalling FullCalendar, deleting my @node_modules folder, running rake assets:clobber
and then rake assets:precompile
.
Is this a FullCalendar problem or a Rails problem?