【问题标题】:error - support for the experimental syntax 'classProperties' isn't currently enabled错误 - 当前未启用对实验语法 \'classProperties\' 的支持
【发布时间】:2022-10-22 02:40:02
【问题描述】:

我正在尝试按照文档https://documentation.engagespot.co/docs/javascript-guide/using-angular-package 在我的 Angular 应用程序中设置 Engagespot

这是代码。

import { Component, ViewChild, ElementRef, AfterViewInit } from "@angular/core";
import { render } from "@engagespot/client";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html"
})
export class AppComponent implements AfterViewInit {
  @ViewChild("engagespotBellIcon") engagespotBellIcon: ElementRef;

  ngAfterViewInit() {
    render(this.engagespotBellIcon.nativeElement, {
      apiKey: "<api_key>",
      userId: "user@sample.com",
      theme: {} //Theme Object to Customize the look and feel of the notification inbox.
    });
  }
}

但它显示错误

SyntaxError
/node_modules/@engagespot/core/dist/esm/index.js: Support for the experimental syntax 'classProperties' isn't currently enabled (1:1717):

更新我尝试了这里提到的 babel 配置 - Support for the experimental syntax 'classProperties' isn't currently enabled。但是同样的错误。

【问题讨论】:

标签: javascript angular


【解决方案1】:

Engagespot 维护者在这里。

这已在@engagespot/client 的最新版本 (v1.1.3) 中得到修复。

您可以查看here

【讨论】:

    猜你喜欢
    • 2019-02-13
    • 2020-08-07
    • 2020-03-06
    • 2021-04-26
    • 2019-12-12
    • 2019-11-10
    • 1970-01-01
    • 1970-01-01
    • 2019-02-15
    相关资源
    最近更新 更多