如何修复 next.js 的打字稿错误?
How to fix typescript error with next.js?
我该如何解决这个错误?我将 next.js 与 typescript 一起使用,但我没有设置 webpack。
我尝试安装@zeit/next-typescript 和 fork-ts-checker-webpack-plugin。
这个错误是因为我的设置造成的?
ERROR in undefined(undefined,undefined):
TS2318: Cannot find global type 'BigInt'.
请多多指教。谢谢
您使用的是哪个版本的 Typescript?我不使用 next.js
但这似乎是一个问题,因为 BigInt
在许多环境中仍未实现。 BigInt
对 Typescript 的支持最近才在 version 3.2 中实现。如果您使用的不是该版本,我建议您首先尝试升级。
我该如何解决这个错误?我将 next.js 与 typescript 一起使用,但我没有设置 webpack。
我尝试安装@zeit/next-typescript 和 fork-ts-checker-webpack-plugin。
这个错误是因为我的设置造成的?
ERROR in undefined(undefined,undefined):
TS2318: Cannot find global type 'BigInt'.
请多多指教。谢谢
您使用的是哪个版本的 Typescript?我不使用 next.js
但这似乎是一个问题,因为 BigInt
在许多环境中仍未实现。 BigInt
对 Typescript 的支持最近才在 version 3.2 中实现。如果您使用的不是该版本,我建议您首先尝试升级。