From 5a13def46d9b91d19ad1bcab6cc2955007dfdf61 Mon Sep 17 00:00:00 2001 From: Karan Janthe <86996507+KMJ-007@users.noreply.github.com> Date: Sat, 21 Oct 2023 18:05:55 +0530 Subject: [PATCH] fix: updated error msg for jsconfig in cli (#1696) * fix: updated error msg for jsconfig in cli * chore: add changeset * style(cli): format --------- Co-authored-by: shadcn --- .changeset/smart-pants-smile.md | 5 +++++ packages/cli/src/utils/get-config.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/smart-pants-smile.md diff --git a/.changeset/smart-pants-smile.md b/.changeset/smart-pants-smile.md new file mode 100644 index 00000000000..b353ce7110e --- /dev/null +++ b/.changeset/smart-pants-smile.md @@ -0,0 +1,5 @@ +--- +"shadcn-ui": patch +--- + +use jsconfig for non-ts projects diff --git a/packages/cli/src/utils/get-config.ts b/packages/cli/src/utils/get-config.ts index b6376d70294..4ea29431c2b 100644 --- a/packages/cli/src/utils/get-config.ts +++ b/packages/cli/src/utils/get-config.ts @@ -65,7 +65,9 @@ export async function resolveConfigPaths(cwd: string, config: RawConfig) { if (tsConfig.resultType === "failed") { throw new Error( - `Failed to load tsconfig.json. ${tsConfig.message ?? ""}`.trim() + `Failed to load ${config.tsx ? "tsconfig" : "jsconfig"}.json. ${ + tsConfig.message ?? "" + }`.trim() ) }