简体   繁体   English

带有 Angular 的 bokehjs:导入时出错

[英]bokehjs with Angular: error while importing

we are trying to import @bokeh/bokehjs in angular 10 and 11 as below:我们正在尝试以角度 10 和 11 导入 @bokeh/bokehjs,如下所示:

import * as Bokeh from '@bokeh/bokehjs';

However we are facing below issues while compiling.然而,我们在编译时面临以下问题。 Compilation error编译错误

Error: node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:115:30 - error TS1005: ']' expected.错误:node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:115:30 - 错误 TS1005: ']' 预期。

115 [key in keyof T & string as ${P}_${key} ]: T[key]; 115 [keyof T & string 中的key as ${P}_${key} ]: T[key]; ~~ node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:115:46 - error TS1005: ';' ~~ node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:115:46 - 错误 TS1005: ';' expected.预期的。

115 [key in keyof T & string as ${P}_${key} ]: T[key]; 115 [keyof T & string 中的key as ${P}_${key} ]: T[key]; ~ node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:115:47 - error TS1128: Declaration or statement expected. ~ node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:115:47 - 错误 TS1128:预期的声明或语句。

115 [key in keyof T & string as ${P}_${key} ]: T[key]; 115 [keyof T & string 中的key as ${P}_${key} ]: T[key]; ~ node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:116:1 - error TS1128: Declaration or statement expected. ~ node_modules/@bokeh/bokehjs/build/js/types/core/property_mixins.d.ts:116:1 - 错误 TS1128:预期的声明或语句。

116 };第116话

Below are the bokehjs and node version we are using下面是我们使用的 bokehjs 和 node 版本

  • bokehjs: 2.3.2散景:2.3.2

  • node: 14.17.3节点:14.17.3

Could anyone please help us fix this and let us know if there is anything we need to do任何人都可以帮我们解决这个问题,如果有什么我们需要做的,请告诉我们

Thanks谢谢

Try to import just the required file from the build subdirectory.尝试仅从 build 子目录导入所需的文件。

Example:例子:

import * as Bokeh from '@bokeh/bokehjs/build/js/lib/embed';

Refer this.参考这个。 I solved my problem using this:我用这个解决了我的问题:

https://discourse.bokeh.org/t/using-bokehjs-in-an-angular-app/5787/7 https://discourse.bokeh.org/t/using-bokehjs-in-an-angular-app/5787/7

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM