Module parse failed: Unexpected token (4:0)
Asked Answered
C

2

5

I'm trying to add FULLCALENDAR to my Angular v14 project.

But after all setup suddenly I'm facing this error

Any idea how to deal with this error?

package.json

"@fullcalendar/angular": "^5.11.0",
"@fullcalendar/daygrid": "^5.11.0",
"@fullcalendar/interaction": "^5.11.0",

app.module.ts

...
import { FullCalendarModule } from '@fullcalendar/angular';
import dayGridPlugin from '@fullcalendar/daygrid';
import interactionPlugin from '@fullcalendar/interaction';

FullCalendarModule.registerPlugins([ // register FullCalendar plugins
dayGridPlugin,
interactionPlugin
]);

imports:[
      ...
      FullCalendarModule
     ]

Throw error

Compiled with problems:X

ERROR in ./node_modules/@fullcalendar/common/main.css 4:0

Module parse failed: Unexpected token (4:0)
You may need an appropriate loader to handle this file type, currently no loaders are 
configured to process this file. See https://webpack.js.org/concepts#loaders
| /* classes attached to <body> */
| /* TODO: make fc-event selector work when calender in shadow DOM */
> .fc-not-allowed,
| .fc-not-allowed .fc-event { /* override events' custom cursors */
|   cursor: not-allowed;


ERROR in ./node_modules/@fullcalendar/daygrid/main.css 2:0

Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type, currently no loaders are 
configured to process this file. See https://webpack.js.org/concepts#loaders
| 
> :root {
|   --fc-daygrid-event-dot-width: 8px;
| }
Cubby answered 9/7, 2022 at 5:28 Comment(0)
B
8

It is a workaround but its not good at all, hope they will fix it as soon as possible

https://github.com/fullcalendar/fullcalendar-angular/issues/403#issuecomment-1149834448

i recommend to add this to the angular.json

"styles" : [
...
"./node_modules/@fullcalendar/common/main.css",
"./node_modules/@fullcalendar/daygrid/main.css",
"./node_modules/@fullcalendar/timegrid/main.css",
"./node_modules/@fullcalendar/list/main.css",
...
],
Burgher answered 15/7, 2022 at 16:38 Comment(0)
L
1

Use version ^6.0.0-beta.1 or higher..

Linalool answered 5/11, 2022 at 15:16 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.