【发布时间】:2021-11-18 21:20:19
【问题描述】:
问题似乎是循环的:
-
package.json没有type: "module"。在这种情况下,在我的打字稿文件中使用模块时出现此错误:
An error occured while running the seed command:
/Users/me/code/me/prisma-learning/graphql-nextjs/prisma/seed.ts:1
import { PrismaClient } from '@prisma/client';
^^^^^^
- 所以我在
package.json中添加了type: "module",这就是现在的错误:
An error occured while running the seed command:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for
/Users/me/code/me/prisma-learning/graphql-nextjs/prisma/seed.ts
我只想在我的 TS 文件中使用 ES6 模块。代码来自官方 Prisma 样板项目: https://github.com/prisma/prisma-examples/tree/latest/typescript/graphql-nextjs
【问题讨论】:
标签: typescript next.js package.json es6-modules react-typescript