首页 \ 问答 \ 升级到Angular 6后构建失败(Build failing after upgrading to Angular 6)

升级到Angular 6后构建失败(Build failing after upgrading to Angular 6)

我刚刚将我的Angular 5项目升级到6.并且构建失败了:

node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-service.d.ts(5,10)中的错误:错误TS2305:模块'“C:/ myapp / node_modules / rxjs / Observable”'没有导出成员'Observable'.node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead.d.ts(3,10):错误TS2305:模块'“C:/ myapp / node_modules / rxjs / Observable”'没有导出的成员'Observable'.node_modules / rxjs / Observable.d.ts(1,15):错误TS2307:找不到模块'rxjs-compat / Observable'。

关于如何解决这个问题的任何想法?

注意:

如果将ng-bootstrap添加到项目(甚至是新的Angular 6项目),则会出现此问题。


I just upgraded my Angular 5 project to 6. And build is failing with:

ERROR in node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-service.d.ts(5,10): error TS2305: Module '"C:/myapp/node_modules/rxjs/Observable"' has no exported member 'Observable'.node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead.d.ts(3,10): error TS2305: Module '"C:/myapp/node_modules/rxjs/Observable"' has no exported member 'Observable'.node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.

Any ideas on how to solve this?

NOTE:

This problem occurs if adding ng-bootstrap to the project (even a new Angular 6 project).


原文:https://stackoverflow.com/questions/50168357
更新时间:2023-09-15 06:09

最满意答案

你是对的:Coq中的类型类只是具有特殊管道和推理的记录(还有单方法类型类的特殊情况,但它不会以任何方式影响这个答案)。 因此,您选择类型类而不是“纯”依赖记录的唯一原因是受益于您使用它们得到的特殊推理:使用普通依赖记录进行推理并不是非常强大,并且不允许您省略很多信息。

作为示例,请考虑以下代码,该代码定义了一个monoid类型类,使用自然数进行实例化:

Class monoid A := Monoid {
  op : A -> A -> A;
  id : A;
  opA : forall x y z, op x (op y z) = op (op x y) z;
  idL : forall x, op id x = x;
  idR : forall x, op x id = x
}.

Require Import Arith.

Instance nat_plus_monoid : monoid nat := {|
  op := plus;
  id := 0;
  opA := plus_assoc;
  idL := plus_O_n;
  idR := fun n => eq_sym (plus_n_O n)
|}.

使用类型类推断,我们可以使用任何直接用于nat任何monoid的定义,而不提供类型类参数,例如

Definition times_3 (n : nat) := op n (op n n).

但是,如果通过“ RecordDefinition替换“ ClassInstance将上述定义转换为常规记录,则相同的定义将失败:

Toplevel input, characters 38-39: Error: In environment n : nat The term "n" has type "nat" while it is expected to have type  "monoid ?11".

对类型类的唯一警告是实例推理引擎有时会有点丢失,导致出现难以理解的错误消息。 话虽这么说,但鉴于这种可能性甚至在那里都没有,它并不是真正的依赖记录。


You are right: type classes in Coq are just records with special plumbing and inference (there's also the special case of single-method type classes, but it doesn't really affect this answer in any way). Therefore, the only reason you would choose type classes over "pure" dependent records is to benefit from the special inference that you get with them: inference with plain dependent records is not very powerful and doesn't allow you to omit much information.

As an example, consider the following code, which defines a monoid type class, instantiating it with natural numbers:

Class monoid A := Monoid {
  op : A -> A -> A;
  id : A;
  opA : forall x y z, op x (op y z) = op (op x y) z;
  idL : forall x, op id x = x;
  idR : forall x, op x id = x
}.

Require Import Arith.

Instance nat_plus_monoid : monoid nat := {|
  op := plus;
  id := 0;
  opA := plus_assoc;
  idL := plus_O_n;
  idR := fun n => eq_sym (plus_n_O n)
|}.

Using type class inference, we can use any definitions that work for any monoid directly with nat, without supplying the type class argument, e.g.

Definition times_3 (n : nat) := op n (op n n).

However, if you make the above definition into a regular record by replacing Class and Instance by Record and Definition, the same definition fails:

Toplevel input, characters 38-39: Error: In environment n : nat The term "n" has type "nat" while it is expected to have type  "monoid ?11".

The only caveat with type classes is that the instance inference engine gets a bit lost sometimes, causing hard-to-understand error messages to appear. That being said, it's not really a disadvantage over dependent records, given that this possibility isn't even available there.

相关问答

更多
  • 你现在可以做的每件事都是 Str[Int].str(1) 要使用1.str你需要引入隐式转换。 你可以使用这种方法: implicit class StrOps[A](val self: A) extends AnyVal { def str(implicit S: Str[A]) = S.str(self) } 这使: scala> 1.str res2: String = 1 Everything you can do now is Str[Int].str(1) to use 1.st ...
  • class Foo < ActiveRecord::Base has_many :foo_bars, :dependent => :destroy end class FooBar < ActiveRecord::Base belongs_to :foo end 如果你的关系如上所述,以下代码将起作用 Foo.delete_all(["id in (?)", [3,4,5,6]]) 要不就 Foo.delete([3,4,5,6]) 删除 EDITED 从小我知道你的问题,我认为你有像下 ...
  • 猜测一下,我会在移动其他进程(并在销毁之前)尝试重新加载lp 。 实例变量可能包含对它认为仍属于它的进程的引用(即使它们不再这样做)。 At a guess, I'd try reloading the lp after moving the other processes (and before destroying it). The instance variable probably contains references to what it thinks are still processes t ...
  • 重写失败的原因是k在S显示为隐藏参数,因此通过重写您使目标输入错误的所有事件。 您可以使用Set Printing All来检查。 by rewrite {5}H3. 将关闭你的目标。 请注意,在mathcomp中不鼓励使用H1...Hn样式的命名目标。 你的缩进也不遵循math-comp风格,你可能想要使用exact:代替by apply: . 使用max_card也可以缩短您的证明: by rewrite -{8}(card_ord k) max_card. 要么 by rewrite -[k in ...
  • State , StateT和其他类似的类型来自transformers ,而MonadState类型类和其他类型类似于它来自mtl 。 注意前者是类型 ,而后者是类型类型 。 来自transformers的类型是Monad和MonadTrans实例。 你可以直接与他们合作,但有一些烦恼: 如果您将monad堆叠了几层,那么您必须在代码中加入大量调用才能访问各层的功能。 有时两种不同的类型提供相同的“界面”。 例如, RWST和ReaderT都提供类似读者的功能,如ask 。 在编写一个函数时,不得不承诺一 ...
  • 你是对的:Coq中的类型类只是具有特殊管道和推理的记录(还有单方法类型类的特殊情况,但它不会以任何方式影响这个答案)。 因此,您选择类型类而不是“纯”依赖记录的唯一原因是受益于您使用它们得到的特殊推理:使用普通依赖记录进行推理并不是非常强大,并且不允许您省略很多信息。 作为示例,请考虑以下代码,该代码定义了一个monoid类型类,使用自然数进行实例化: Class monoid A := Monoid { op : A -> A -> A; id : A; opA : forall x y z, ...
  • 问题是Forall_dec在标准库中被定义为不透明(也就是说,用Qed代替Defined )。 因此,Coq不知道使用wfdec是有效的。 您的问题的直接解决方案是重新定义Forall_dec以使其透明。 您可以通过打印Coq生成的证明术语并将其粘贴到源文件中来完成此操作。 我在这里添加了一个完整的解决方案。 不用说,这种方法使其本身变得臃肿,难以阅读,并且难以维护代码。 正如ejgallego在他的回答中指出的那样,在这种情况下,最好的办法是定义一个决定WF的布尔函数,并用它来代替WFDec 。 正如他所 ...
  • 最快的方法可能是在db控制台中执行它的目录,但是如果你有其他依赖关系和activerecord回调你需要被触发,你可以做类似的事情: Post.where("id in (select p.id from posts p left outer join users u on p.user_id = u.id where u.id is null)").destroy_all Fastest way would probably be to do it directory in the db console ...
  • zltz与nltz 0具有相同的类型。 Check zltz. Check nltz 0. 使用2和[1; 2; 3] [1; 2; 3] [1; 2; 3]从另一个函数中,你可以使用lt_dec 。 Eval compute in match lt_dec 2 (length [1; 2; 3]) with | left pf => safe_nth 2 [1; 2; 3] pf | right _ => 0 end. 如果你提取lt_dec ,你会发现它在擦除证据后与lt_dec非常相似 ...
  • 您正在导入Foldable[List]的实例两次:一次import cats.implicits._ ,一次import cats.instances.all._ 。 他们变得模棱两可。 查看源代码,您可以看到cats.instances.all是cats.instances.all的子集。 简化: package cats { package object instances { object all extends AllInstances } object implicits e ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。