【发布时间】:2021-06-05 10:37:55
【问题描述】:
我在构建应用程序时遇到了某种编译失败。
node_modules/@mycomp/lib-my-pat/shared/store/selectors/filter.selector.d.ts:5:75 - error TS2304: Cannot find name 'Interval'.
const getDateInterval: import("@ngrx/store").MemoizedSelector<object, Interval, import("@ngrx/store").DefaultProjectorFn<Interval>>;
它说Cannot find name 'Interval'.,即使它可用。但它来自不同的库,其他库也使用这个间隔,它在应用程序中运行良好。这个库只通过这样说引发编译问题。
如果我将这个有问题的库链接到本地应用程序并运行,它可以正常工作。
此时间间隔来自date-fns 库。它已被添加为库的对等依赖项和应用程序的依赖项。还有一些其他库也在应用程序中使用相同的间隔,并且工作正常。我该如何解决这个问题?
【问题讨论】:
标签: angular dependency-management angular-workspace-configuration