Angular 14:FullCalendar进口使编译失败
因此,基本上,我想在我的Angular 14应用程序中添加 @fullcalendar/angular的日历,其中我使用SCSS(如果是相关的,则IDK)。
问题是当我在app.modules.ts中导入所需的内容时,
...
import { FullCalendarModule } from '@fullcalendar/angular';
import interactionPlugin from '@fullcalendar/interaction';
import dayGridPlugin from '@fullcalendar/daygrid';
FullCalendarModule.registerPlugins([
interactionPlugin,
dayGridPlugin
]);
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FullCalendarModule,
HttpClientModule
],
providers: [],
bootstrap: [AppComponent]
})
汇编失败了,我会得到这些错误:
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;
| }
ERROR
../node_modules/@fullcalendar/angular/lib/fullcalendar.component.d.ts:17:18 - error TS2314: Generic type 'ɵɵComponentDeclaration' requires 7 type argument(s).
17 static ɵcmp: ɵngcc0.ɵɵComponentDeclaration<FullCalendarComponent, "full-calendar", never, { "options": "options"; "deepChangeDetection": "deepChangeDetection"; }, {}, never, never, false>;
您对此有所了解吗?提前提前。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对你也一样。但是我尝试使用Angular 13,然后正常工作。
https://fullcalendar.io/docs/angular 有关更多信息
same to you. but i try with angular 13 then it's working ok.
https://fullcalendar.io/docs/angular for more information
发现这是一个角度问题。
一个修复程序是在Angular.json中导入FullCalendar的CSS文件:
另一个修复程序是添加将删除CSS自动导入的脚本。它使它这样做:
您必须将其放在文件树中的根级别。然后在类似的样式文件中手动添加CSS导入:
源:
Found out it was an Angular issue.
A fix is to import fullcalendar's CSS files in angular.json like so :
Another fix is to add a script that will remove auto import of the CSS. It makes something like that :
You have to put it at root level in the file tree. And then add CSS import manually in a style file like so :
Source : https://github.com/fullcalendar/fullcalendar-angular/issues/403
从Angular CLI 13-&GT进行更新时,我遇到了这个问题。 14
解决方案: https://github.com/fullcalendar/fullcalendar-angular/issues/403#issuecomment-1150437324
I had this problem when updating from Angular Cli 13 -> 14
Solution : https://github.com/fullcalendar/fullcalendar-angular/issues/403#issuecomment-1150437324