Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

segment is undefined client side on error page #1343

Closed
nikse opened this issue Jul 27, 2020 · 1 comment
Closed

segment is undefined client side on error page #1343

nikse opened this issue Jul 27, 2020 · 1 comment

Comments

@nikse
Copy link

nikse commented Jul 27, 2020

Describe the bug
A clear and concise description of what the bug is.

The segment variable is undefined on client side (defined on server side) in the _layout.svelte file when rendering the _error.svelte file

Logs
Please include browser console and server logs around the time this bug occurred.

To Reproduce
To help us help you, if you've found a bug please consider the following:

Run sapper starter template and navigate to /a with the following code in _layout.svelte

export let segment;
console.log(segment) // ssr: "a", client: undefined
  • If possible, we recommend creating a small repo that illustrates the problem.
  • Reproductions should be small, self-contained, correct examples – http://sscce.org.

Occasionally, this won't be possible, and that's fine – we still appreciate you raising the issue. But please understand that Svelte is run by unpaid volunteers in their free time, and issues that follow these instructions will get fixed faster.

Expected behavior
A clear and concise description of what you expected to happen.

Client side segment should have the same value as the server side

Stacktraces
If you have a stack trace to include, we recommend putting inside a <details> block for the sake of the thread's readability:

Stack trace

Stack trace goes here...

Information about your Sapper Installation:

  • Your browser and the version: (e.x. Chrome 52.1, Firefox 48.0, IE 10)

  • Your operating system: (e.x. OS X 10, Ubuntu Linux 19.10, Windows XP, etc)

  • Your hosting environment: (i.e. Local, GCP, AWS, Now, etc...)

  • Sapper version (Please check you can reproduce the issue with the latest release!)

  • Svelte version (Please check you can reproduce the issue with the latest release!)

  • If it is an exported (npm run export) or dynamic application.

  • Whether your application uses Webpack or Rollup

Severity
How severe an issue is this bug to you? Is this annoying, blocking some users, blocking an upgrade or blocking your usage of Sapper entirely?

Note: the more honest and specific you are here the more we will take you seriously.

Additional context
Add any other context about the problem here.

@Conduitry
Copy link
Member

Approximately a duplicate of #948 and a few other related issues.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants