Skip to content

Commit f7bb8b1

Browse files
committed
chore(cli): Prevent swallowing error in non production env
1 parent 0307304 commit f7bb8b1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/cli/medusa-cli/cli.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
try {
44
require("ts-node").register({})
55
require("tsconfig-paths").register({})
6-
} catch {}
6+
} catch (e) {
7+
const isProduction = process.env.NODE_ENV === "production"
8+
if (!isProduction) {
9+
console.warn(
10+
"ts-node cannot be loaded and used, if you are running in production don't forget to set your NODE_ENV to production"
11+
)
12+
console.warn(e)
13+
}
14+
}
715
require("dotenv").config()
816
require("./dist/index.js")

0 commit comments

Comments
 (0)