typescript error when working with prisma and postgresql

Viewed 33

https://www.prisma.io/blog/fullstack-nextjs-graphql-prisma-oklidw1rhw

i went through this tutorial on working with postgresql database using prisma. near the end of the tutorial, I encountered the following typescript error at the stage of Seeing the database:

npx prisma db seed --preview-feature

prisma:warn Prisma "db seed" was in Preview and is now Generally Available. You can now remove the --preview-feature flag. prisma:warn The "ts-node" script in the package.json is not used anymore since version 3.0 and can now be removed. Environment variables loaded from .env Running seed command ts-node prisma/seed.ts ... /home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: prisma/seed.ts:2:10 - error TS2305: Module '"../data/links"' has no exported member 'data'.

2 import { data } from '../data/links' ~~~~

at createTSError (/home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:859:12)
at reportTSError (/home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:863:19)
at getOutput (/home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:1077:36)
at Object.compile (/home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:1433:41)
at Module.m._compile (/home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:1617:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
at Object.require.extensions.<computed> [as .ts] (/home/superuserfucker/Documents/Code/actualfullstack/awesome-links/node_modules/ts-node/src/index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1004:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {

diagnosticCodes: [ 2305 ] }

An error occured while running the seed command: Error: Command failed with exit code 1: ts-node prisma/seed.ts

/prisma/schema.prismaenter image description
here

package.json file:enter image description here

export const links = [

{ category: "Open Source", description: "Fullstack React framework", id: "8a9020b2-363b-4a4f-ad26-d6d55b51bqes", imageUrl: "https://nextjs.org/static/twitter-cards/home.jpg", title: "Next.js", url: "https://nextjs.org", }, { category: "Open Source", description: "Next Generation ORM for TypeScript and JavaScript", id: "2a3121b2-363b-4a4f-ad26-d6c35b41bade", imageUrl: "https://www.prisma.io/images/og-image.png",

title: "Prisma",
url: "https://prisma.io",

}, { category: "Open Source", description: "Utility-fist css framework", id: "6a9122b2-363b-4a4f-ad26-d6c55b51baed", imageUrl: "https://tailwindcss.com/_next/static/media/twitter-large-card.85c0ff9e455da585949ff0aa50981857.jpg", title: "TailwindCSS", url: "https://tailwindcss.com", }, { category: "Open Source", description: "GraphQL implementation ", id: "2ea8cfb0-44a3-4c07-bdc2-31ffa135ea78", imageUrl: "https://www.apollographql.com/apollo-home.jpg", title: "Apollo GraphQL", url: "https://apollographql.com", }, ];

0 Answers
Related