【问题标题】:("node_modules/next/types/index")' has no compatible call signatures("node_modules/next/types/index")' 没有兼容的调用签名
【发布时间】:2019-06-23 01:27:07
【问题描述】:

我正在尝试使用nextjs documentation 中详述的 next.js 设置自定义服务器,但这次我使用的是打字稿。我不断收到("node_modules/next/types/index")' has no compatible call signatures。看来我没有以正确的方式导入 nextjs。我错过了什么?

import "isomorphic-fetch";
import next from "next"; // I also tried import * as next from "next

const dev = (process as any).env.NODE_ENV !== "production";
const app = next({ dev });  // Typescript is complaining on this line.

我错过了什么?

编辑:我使用的是最新版本 v8.1.1-canary.55 nextjs

【问题讨论】:

    标签: reactjs typescript next.js


    【解决方案1】:

    这似乎是known issue。降级 next^8.1.0 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 2019-01-24
      • 2018-11-28
      • 2017-12-29
      • 2017-03-20
      • 1970-01-01
      • 2017-12-05
      • 2019-04-08
      • 2019-01-26
      • 2019-09-23
      相关资源
      最近更新 更多