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

🐛 Improve error message for missing javascript and python plugins #1835

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

JimMadge
Copy link
Contributor

@JimMadge JimMadge commented Feb 4, 2025

Closes #1813

It looks like the problem was here

if (!fs.statSync(path).isFile || !path.endsWith('.mjs')) {

fs.statSync raises an error if there is no file/directory.
This PR adds an option so that fs.statSync returns undefined if there is no file, then handles that possibility when calling isFile().

I see that there is another instance of fs.statSync(...).isFile() in plugins.ts that might cause similar problems.

Copy link

changeset-bot bot commented Feb 4, 2025

🦋 Changeset detected

Latest commit: dbe6279

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
myst-cli Patch
mystmd Patch

Not sure what this means? Click here to learn what changesets are.

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

@rowanc1
Copy link
Member

rowanc1 commented Feb 4, 2025

Thanks, this looks good. Will merge when tests go green.

Thanks @JimMadge.

@rowanc1
Copy link
Member

rowanc1 commented Feb 4, 2025

Have expanded to cover the python ones as well. cc @agoose77.

@rowanc1 rowanc1 changed the title Improve error message for missing javascript plugins 🐛 Improve error message for missing javascript and python plugins Feb 4, 2025
@rowanc1 rowanc1 merged commit b516d4f into jupyter-book:main Feb 4, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error message for missing plugin .mjs file
2 participants