Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cli): Prevent swallowing error in non production env #11534

Merged
merged 1 commit into from
Feb 19, 2025

Conversation

adrien2p
Copy link
Member

@adrien2p adrien2p commented Feb 19, 2025

What
It happened many times that people can't run their project locally because an error is thrown during the config file loading. It occurs that this error can often happen because of some missing deps such as swc/core. But since the error is being swallowed, the import API will look for the js file which often does not exists (as it has not been built) and lead to hard debugging situation.

In order to prevent that, we could warn about any error that might occur when running the CLI as long as we are not in production. this error can be ignored if ts-node is not of any use in particular scenarios

Copy link

vercel bot commented Feb 19, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 19, 2025 3:58pm
6 Skipped Deployments
Name Status Preview Comments Updated (UTC)
api-reference ⬜️ Ignored (Inspect) Feb 19, 2025 3:58pm
api-reference-v2 ⬜️ Ignored (Inspect) Feb 19, 2025 3:58pm
docs-ui ⬜️ Ignored (Inspect) Feb 19, 2025 3:58pm
docs-v2 ⬜️ Ignored (Inspect) Feb 19, 2025 3:58pm
medusa-docs ⬜️ Ignored (Inspect) Feb 19, 2025 3:58pm
resources-docs ⬜️ Ignored (Inspect) Feb 19, 2025 3:58pm

Copy link

changeset-bot bot commented Feb 19, 2025

⚠️ No Changeset found

Latest commit: f7bb8b1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@adrien2p
Copy link
Member Author

@olivermrbl @thetutlage if I could get your opinion on this?

@adrien2p adrien2p marked this pull request as ready for review February 19, 2025 16:01
@adrien2p adrien2p requested a review from a team as a code owner February 19, 2025 16:01
@olivermrbl
Copy link
Contributor

Think this is nice, very helpful!

@thetutlage
Copy link
Contributor

Looks good to me

@olivermrbl olivermrbl merged commit 0a95c6f into develop Feb 19, 2025
24 checks passed
@olivermrbl olivermrbl deleted the chore/cli-tsnode branch February 19, 2025 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants