Skip to content

Commit

Permalink
chore(cli): Prevent swallowing error in non production env
Browse files Browse the repository at this point in the history
  • Loading branch information
adrien2p committed Feb 19, 2025
1 parent 0307304 commit f7bb8b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion packages/cli/medusa-cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
try {
require("ts-node").register({})
require("tsconfig-paths").register({})
} catch {}
} catch (e) {
const isProduction = process.env.NODE_ENV === "production"
if (!isProduction) {
console.warn(
"ts-node cannot be loaded and used, if you are running in production don't forget to set your NODE_ENV to production"
)
console.warn(e)
}
}
require("dotenv").config()
require("./dist/index.js")

0 comments on commit f7bb8b1

Please sign in to comment.