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

use node export condition when bundling #9276

Merged
merged 1 commit into from
Mar 2, 2023
Merged

use node export condition when bundling #9276

merged 1 commit into from
Mar 2, 2023

Conversation

Rich-Harris
Copy link
Member

closes #9264. The issue was that the dependency in question, vidstack, has a bunch of different exports for different conditions; the node condition points at a module that is capable of running on the server.

When running in dev and preview, the module was loaded through Node, and so naturally the node condition was used. But adapter-node bundles the dependency using the default condition, which points at a production browser build.

This PR fixes it by using the node export condition for resolution when bundling dependencies.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@dummdidumm dummdidumm merged commit e070b14 into master Mar 2, 2023
@dummdidumm dummdidumm deleted the gh-9264 branch March 2, 2023 10:05
@github-actions github-actions bot mentioned this pull request Mar 2, 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.

Sveltekit DEV server doesn't error when importing js code that uses client-side apis
2 participants