模块解析失败:意外令牌(4:0)



我想把FULLCALENDAR添加到我的Angular v14项目中。

但是在所有设置之后,我突然面临这个错误

知道如何处理这个错误吗?

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
]
<<p>抛出错误/strong>
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;
| }

这是一个变通办法,但它不是很好,希望他们能尽快解决它

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

我建议把它添加到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",
...
],

使用版本^6.0.0-beta。

相关内容

  • 没有找到相关文章