Skip to content

fix: relax community add-on requirements (alternate) - #1233

Open
AdrianGonz97 wants to merge 4 commits into
version-1from
1225-alternative
Open

fix: relax community add-on requirements (alternate)#1233
AdrianGonz97 wants to merge 4 commits into
version-1from
1225-alternative

Conversation

@AdrianGonz97

Copy link
Copy Markdown
Member

Description

Alternative to #1224
Closes #1210

Rather than simply checking the export conditions and dependency fields for non-bundled deps, we'll instead try to load the module and handle the specific node error code for missing modules, which would be indicative of deps that are not bundled.

note: this hasn't been tested on Bun or Deno yet. their missing module error codes could be different. will do that shortly. It looks to work on Bun and Deno as well (though if someone else could verify this as well, that would be great!)

Checklist

  • Update snapshots (if applicable)
  • Add a changeset (if applicable)
  • Allow maintainers to edit this PR
  • I care about what I'm doing, no matter the tool I use (Notepad, Sublime, VSCode, AI...)

@pkg-svelte-dev

pkg-svelte-dev Bot commented Aug 7, 2026

Copy link
Copy Markdown

Install the latest version of sv from 3d0be1f:

pnx https://pkg.svelte.dev/sv/c/3d0be1f27f57e11b6c3af0c3248a98059a8c1c2d create

Open in pkg.svelte.dev: https://pkg.svelte.dev/repos/cli/pr/1233

@changeset-bot

changeset-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3d0be1f

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

This PR includes changesets to release 1 package
Name Type
sv 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

@svelte-docs-bot

Copy link
Copy Markdown

jycouet and others added 3 commits August 20, 2026 23:43
* fix(addon): harden add-on entry point resolution

Try `./sv` then `.` as documented, instead of bailing on the first
failure. Stop rejecting valid `exports` shapes (bare string, conditions
only, absent) before attempting an import, handle the CJS
`MODULE_NOT_FOUND` code, and keep Node's message so the missing module
is named.

Document that `sv` provides `@sveltejs/sv-utils` and that leaving it
unbundled couples the add-on to whatever version `sv` ships.

* Update packages/sv/src/core/common.ts

Co-authored-by: CokaKoala <31664583+AdrianGonz97@users.noreply.github.com>

---------

Co-authored-by: CokaKoala <31664583+AdrianGonz97@users.noreply.github.com>
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.

Relax sv add requirements

2 participants