From 61df6d6a649e07157ea8c988a8034b0552c6c86f Mon Sep 17 00:00:00 2001 From: Shreyaschorge Date: Sat, 19 Jul 2025 03:12:54 +0530 Subject: [PATCH] fix: Unknown file extension '.ts' issue --- package.json | 4 ++-- scripts/deploy.ts | 2 +- tsconfig.json | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index a855ee6..bbb40c4 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "build:raw": "next build", "start": "next start", "lint": "next lint", - "deploy:vercel": "ts-node scripts/deploy.ts", + "deploy:vercel": "node --loader ts-node/esm scripts/deploy.ts", "deploy:raw": "vercel --prod", "cleanup": "node scripts/cleanup.js" }, @@ -52,4 +52,4 @@ "@types/node": "^22.13.10", "typescript": "^5.6.3" } -} +} \ No newline at end of file diff --git a/scripts/deploy.ts b/scripts/deploy.ts index a96a637..4fb429a 100755 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -7,7 +7,7 @@ import inquirer from 'inquirer'; import dotenv from 'dotenv'; import crypto from 'crypto'; import { Vercel } from '@vercel/sdk'; -import { APP_NAME, APP_BUTTON_TEXT } from '../src/lib/constants'; +import { APP_NAME, APP_BUTTON_TEXT } from '../src/lib/constants.js'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const projectRoot = path.join(__dirname, '..'); diff --git a/tsconfig.json b/tsconfig.json index df87999..0060acb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -22,6 +22,13 @@ "~/*": ["./src/*"] } }, + "ts-node": { + "esm": true, + "compilerOptions": { + "module": "ES2020", + "moduleResolution": "node" + } + }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"] }