Skip to content

Commit

Permalink
fix(cli): better error message for tsconfig error
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan-karger committed Nov 8, 2023
1 parent 5702883 commit fb2d859
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rich-sloths-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"solidui-cli": patch
---

fix: trying to read a malformed tsconfig.json now exits and shows a better error message
7 changes: 6 additions & 1 deletion packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ function writeTsconfig(alias: string) {
indicator.start("Configuring your tsconfig.json")

readJsonFile(process.cwd() + "/tsconfig.json", (error, data) => {
if (error) log.error("Something went wrong while configuring your tsconfig.json")
if (error) {
log.error(
"Something went wrong while configuring your tsconfig.json. Please make sure it is formatted correctly and doesn't contain any comments."
)
process.exit(1)
}

const tsconfigData = data as Record<string, { paths: Record<string, unknown> }>

Expand Down

0 comments on commit fb2d859

Please sign in to comment.