Skip to content

Commit

Permalink
fix(cli): resolve cannot import module
Browse files Browse the repository at this point in the history
If tsconfig.json didn't have the settings for ts-node
it ended up giving this error because it could only use CommonJS.
Just override one of the user project settings to be able to use CommonJS.
  • Loading branch information
igorwessel committed Oct 10, 2021
1 parent cb49051 commit e0a004b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .changeset/violet-frogs-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@chakra-ui/cli": minor
---

If tsconfig.json didn't have the settings for ts-node it ended up giving this
error because it could only use CommonJS. I just override one of the user
project settings to be able to use CommonJS.
3 changes: 3 additions & 0 deletions tooling/cli/src/scripts/read-theme-file.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ async function readTheme(themeFilePath: string) {
tsNode.register({
// use the TS projects own tsconfig file
project: tsConfig.configFileAbsolutePath,
compilerOptions: {
module: "CommonJS",
},
})

/**
Expand Down

0 comments on commit e0a004b

Please sign in to comment.