Anas Badran
Anas Badran
Explore posts from servers
PPrisma
Created by Anas Badran on 8/11/2024 in #help-and-questions
unique constraints
I will do that in the code, but does prisma supports this constraint?
4 replies
PPrisma
Created by Anas Badran on 5/19/2024 in #help-and-questions
Unable to run the seed script successfully
it also didn't work
7 replies
PPrisma
Created by Anas Badran on 5/19/2024 in #help-and-questions
Unable to run the seed script successfully
I also tried to change the seed script:
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts",
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts",
7 replies
PPrisma
Created by Anas Badran on 5/19/2024 in #help-and-questions
Unable to run the seed script successfully
The error
 dashboard  pn run seed

> @ seed D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard
> ts-node prisma/seed.ts

(node:28944) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\prisma\seed.ts:1
import { db } from '@/app/lib/database';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:128:18)
at wrapSafe (node:internal/modules/cjs/loader:1280:20)
at Module._compile (node:internal/modules/cjs/loader:1332:27)
at Module.m._compile (D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\node_modules\.pnpm\ts-node@10.9.2_@types+node@20.5.7_typescript@5.2.2\node_modules\ts-node\src\index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Object.require.extensions.<computed> [as .ts] (D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\node_modules\.pnpm\ts-node@10.9.2_@types+node@20.5.7_typescript@5.2.2\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at phase4 (D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\node_modules\.pnpm\ts-node@10.9.2_@types+node@20.5.7_typescript@5.2.2\node_modules\ts-node\src\bin.ts:649:14)
 ELIFECYCLE  Command failed with exit code 1.
 dashboard  pn run seed

> @ seed D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard
> ts-node prisma/seed.ts

(node:28944) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\prisma\seed.ts:1
import { db } from '@/app/lib/database';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at internalCompileFunction (node:internal/vm:128:18)
at wrapSafe (node:internal/modules/cjs/loader:1280:20)
at Module._compile (node:internal/modules/cjs/loader:1332:27)
at Module.m._compile (D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\node_modules\.pnpm\ts-node@10.9.2_@types+node@20.5.7_typescript@5.2.2\node_modules\ts-node\src\index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Object.require.extensions.<computed> [as .ts] (D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\node_modules\.pnpm\ts-node@10.9.2_@types+node@20.5.7_typescript@5.2.2\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at phase4 (D:\coding\evolving\JavaScript\next\nextjs-dashboard\dashboard\node_modules\.pnpm\ts-node@10.9.2_@types+node@20.5.7_typescript@5.2.2\node_modules\ts-node\src\bin.ts:649:14)
 ELIFECYCLE  Command failed with exit code 1.
7 replies