【问题标题】:How to use angular library locally with hot reload? [Error: Cannot read properties of null (reading 'firstCreatePass')]如何通过热重载在本地使用角度库? [错误:无法读取 null 的属性(读取“firstCreatePass”)]
【发布时间】:2022-02-10 21:51:47
【问题描述】:

我在本地有两个angular项目,第一个是自定义库(createApplication=false),第二个是test-app;

现在我想在 test-app 中使用自定义库的组件,并进行热重载;

我正在做的是:

  1. 在库内运行npm run build --watch
  2. 在测试应用内运行npm install ../library/dist/test-library

除了控制台内的一个运行时错误之外,一切都很好:ERROR TypeError: Cannot read properties of null (reading 'firstCreatePass')

我以这篇文章为指导:link

【问题讨论】:

    标签: angular angular-library


    【解决方案1】:

    您只有最后一步需要处理:angular.json 中的配置。 按照这篇文章,你应该没问题:

    https://medium.com/@maravondra/angular-component-in-locale-usage-8536d91fc844

    "preserveSymlinks": true
    

    【讨论】:

      猜你喜欢
      • 2020-10-20
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      • 2022-07-24
      • 2021-11-07
      • 1970-01-01
      • 1970-01-01
      • 2022-07-27
      相关资源
      最近更新 更多