ngx-leaflet-draw:导入没有 ɵmod 属性的模块 [英] ngx-leaflet-draw: Importing module which does not have a ɵmod property

查看:87
本文介绍了ngx-leaflet-draw:导入没有 ɵmod 属性的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

导入没有 ɵmod 属性的 LeafletDrawModule

Importing LeafletDrawModule which does not have a ɵmod property

我在单元测试期间看到了这个错误(开玩笑).

I am seeing this error during my unit testing(jest).

当我运行 ng 应用程序时,代码运行良好.传单绘制功能完美.

The code works fine when I run the ng application. Leaflet draw function works perfectly.

Angular: 11
@asymmetrik/ngx-leaflet: 8.1.0
@asymmetrik/ngx-leaflet-draw: 7.0.0

当单元测试组件引用 LeafletDrawModule 时会发生此错误

This error happens when unit testing components referencing LeafletDrawModule

推荐答案

终于找到解决方案了.

在模块文件夹上运行 ngcc 后,问题自行解决.

After running ngcc on the module folder the issue resolved itself.

如果您得到 ngcc' 未被识别为内部或外部命令,您还没有在 PATH 中配置 nodemodule 二进制路径.你可以从 [project_path]\node_modules\.bin\ngcc

Incase you get ngcc' is not recognized as an internal or external command you haven't configured the nodemodule binary path in PATH. You can get execute it from [project_path]\node_modules\.bin\ngcc

如果你在 package.json 中配置了 postinstall,

If you have the postinstall configured in package.json,

"scripts": {
   .
   "postinstall": "ngcc",
   .
}

运行 npm run postintall.

这篇关于ngx-leaflet-draw:导入没有 ɵmod 属性的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆