Skip to content

Conversation

@gtm-nayan
Copy link
Contributor

fixes #7257

Testing it would require creating a new project I think, and even then it likely wouldn't be deterministic so no tests for this one.

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:.

@changeset-bot
Copy link

changeset-bot bot commented Apr 30, 2023

🦋 Changeset detected

Latest commit: 6098df2

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

return invalidate();
},

// TODO: Why is only this camel cased?
Copy link
Member

Choose a reason for hiding this comment

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

No particular good reason, as far as I can tell, since some other things from here that are exposed in packages/kit/src/runtime/app/navigation.js are snake case in this file and then camel case in that file.

Copy link
Member

Choose a reason for hiding this comment

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

This was added in #6493. I assume it was just a tiny slip-up. I'd be in favor of switching to invalidate_all.

@Rich-Harris
Copy link
Member

This does feel like a bit it's addressing the symptoms rather than the cause — I thought we'd already gone to some lengths to ensure that the client is initialised before any user code is imported. Would love to see if we can figure out how that's breaking, though if that turns out to be a massive rabbit hole then I'm not strongly opposed to this approach

@gtm-nayan
Copy link
Contributor Author

It works well with the default settings, no symptoms or cause there, but once you start overriding it with manualChunks or experimentalMinChunkSize, it breaks because the navigation module ends up in the same chunk as the app entry's dependencies so the exports get evaluated before client is initialized.

I tried forcing navigation into its own chunk but even that seems to mess up the order somehow and it's small enough to not warrant its own chunk.

The client hooks are one of app's dependencies, so importing $app/navigation currently doesn't work there, although not sure whether that's something anyone will need.

@Rich-Harris
Copy link
Member

Ah, fair enough — guess there's really not much else we can do in that case. Merging! Thanks

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.

Cannot read properties of undefined (reading 'disable_scroll_handling')

4 participants