【发布时间】: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