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

fix(storage): validate and skip invalid mounts #1805

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

GalacticHypernova
Copy link
Contributor

@GalacticHypernova GalacticHypernova commented Oct 7, 2023

πŸ”— Linked issue

fix #1804

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This change checks whether or not the driver was provided to the storage mount point, as opts.driver in the createStorage method is reading the driver. As a result, in previous versions, if no driver was provided, the build errors (which I have tested thoroughly) as it's trying to import a non-existing package with no proper error handling (non-existing due to the driver being "undefined"). This fixes that issue by not trying to import the driver if it wasn't specified, and in stead warning the user that the storage was not mounted, therefore allowing the build process to continue and succeed. In addition, this improves the DX as this error message provides more info than the previous default "Cannot find package 'undefined'", which may be confusing for new developers.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@GalacticHypernova GalacticHypernova changed the title fix: check for driver options and don't error out fix: check for driver options before importing Oct 7, 2023
@GalacticHypernova GalacticHypernova changed the title fix: check for driver options before importing fix(storage): check for driver before importing Oct 8, 2023
@pi0 pi0 changed the title fix(storage): check for driver before importing fix(storage): validate and skip invalid mounts Oct 18, 2023
@pi0 pi0 merged commit dfc2477 into unjs:main Oct 18, 2023
4 of 6 checks passed
@pi0
Copy link
Member

pi0 commented Oct 18, 2023

Thanks!

@GalacticHypernova
Copy link
Contributor Author

Glad to help!

@GalacticHypernova GalacticHypernova deleted the patch-1 branch October 18, 2023 16:53
pi0 added a commit that referenced this pull request Oct 18, 2023
@pi0 pi0 mentioned this pull request Oct 19, 2023
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.

Nitro fails to build when storage driver isn't given
2 participants