Skip to content

Conversation

@Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Sep 23, 2022

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. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2022

🦋 Changeset detected

Latest commit: 12befed

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit 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

@Conduitry
Copy link
Member

Should we have another bigger try-catch here in case there are other weird unexpected errors? Given what we're using the postinstall script for here, it doesn't seem to me there would ever be a situation where I would prefer the whole install to fail.

@Rich-Harris
Copy link
Member Author

In general I'm not a fan of all-encompassing try-catch blocks, because they prevent us from catching actual logic bugs. Like, the thing in #6987 (comment) with workspaces not being an array of strings — if we just wrapped the whole thing then we wouldn't encounter that situation, we'd just bail out. I guess we could print the error and still exit with code 0

@Conduitry
Copy link
Member

Logging the exception sounds fine. I'm just saying that we shouldn't fail the whole install, because that doesn't help anyone, especially for something that would be generated when they build the project anyway.

@Rich-Harris Rich-Harris merged commit 84ad168 into master Sep 23, 2022
@Rich-Harris Rich-Harris deleted the gh-6987 branch September 23, 2022 19:39
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.

postinstall fails if workspaces uses object notation Postinstall breaks when package.json is missing (for instance on a pnpm fetch)

4 participants