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(createIconPack): handle unresolved modules #148

Merged
merged 3 commits into from Dec 5, 2023

Conversation

kripod
Copy link
Contributor

@kripod kripod commented Oct 21, 2023

When trying to build a site with a custom icon pack using the astro/tsconfigs/strict TSConfig, tsc --noEmit fails:

Error: node_modules/.pnpm/astro-icon@0.8.1/node_modules/astro-icon/lib/createIconPack.ts(18,45): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
 ELIFECYCLE  Command failed with exit code 2.

It turns out that resolvePackage may return undefined, therefore this edge-case should be handled.

@changeset-bot
Copy link

changeset-bot bot commented Oct 21, 2023

🦋 Changeset detected

Latest commit: fd25e4e

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

This PR includes changesets to release 2 packages
Name Type
astro-icon Patch
www 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

@vercel
Copy link

vercel bot commented Oct 21, 2023

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

Name Status Preview Comments Updated (UTC)
api-astroicon ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2023 7:38pm
astroicon ❌ Failed (Inspect) Dec 5, 2023 7:38pm

Copy link
Owner

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the PR!

@natemoo-re natemoo-re merged commit d176a7d into natemoo-re:main Dec 5, 2023
2 of 5 checks passed
@github-actions github-actions bot mentioned this pull request Dec 5, 2023
@kripod kripod deleted the patch-1 branch December 5, 2023 22:40
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.

None yet

2 participants