fix: return null instead of throwing on unresolved modules in resolveId#273
Conversation
🦋 Changeset detectedLatest commit: fa1b533 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this comment.
Pull request overview
This PR fixes the resolveId hook to follow the Rollup plugin specification by returning null instead of throwing an error when a module cannot be resolved. This enables proper module resolution in multi-framework projects where non-Qwik modules are imported from Astro files.
Changes:
- Modified the
resolveIdhook to returnnullinstead of throwing when resolution fails - Applied automated formatting fixes across multiple files using Biome
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| libs/qwikdev-astro/src/index.ts | Changed error throw to return null in resolveId hook; applied import reordering and formatting fixes |
| libs/qwikdev-astro/src/virtual.d.ts | Removed trailing whitespace |
| libs/qwikdev-astro/server.ts | Reordered imports and removed trailing whitespace/comma |
| libs/qwikdev-astro/package.json | Collapsed files array to single line |
| apps/demo/src/components/qwik/counter.tsx | Applied consistent formatting to component definition |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
commit: |
There was a problem hiding this comment.
Hey @Kenzo-Wada! Thanks for the PR 🙏 .
Could we keep the error message but as a debug log instead of removed entirely? Other than that LGTM and good to merge.
|
@thejackshelton thank you for the review! just commited fa1b533. am i doing the right thing? |
The
resolveIdhook currently throws an error when it cannot resolve a module. Per the Rollup plugin spec, it should returnnullto let other plugins or Vite handle the resolution.This fixes builds in multi-framework projects where non-Qwik modules are imported from
.astrofiles.Note: This PR also includes some lint/formatter fixes.