`Goto` not working

See original GitHub issue

Describe the bug

When working in dev everything is working fine with no errors. But when deploying to prod (npm start / preivew) the applciation crashes.

I thought it was a third-party dependency npm package but upon removing pages and components, I noticed it pointed to import { goto } from '$app/navigation';

Once removing it from the imports it fixed the issue and the app loaded normally.


Error with import { goto } from '$app/navigation';

Uncaught TypeError: Cannot read properties of undefined (reading 'disable_scroll_handling')

Reproduction

  1. npm create svelte@latest my-app
√ Which Svelte app template? » Skeleton project
√ Add type checking with TypeScript? » Yes, using TypeScript syntax
√ Add ESLint for code linting? ... No / [x] Yes
√ Add Prettier for code formatting? ... No / [x] Yes
√ Add Playwright for browser testing? ... No / [x] Yes
  1. navigate into the my-app directory

  2. install vite-plugin-chunk-split from: npm i vite-plugin-chunk-split

  3. update the vite.config.js to:

import { sveltekit } from '@sveltejs/kit/vite';
import { chunkSplitPlugin } from 'vite-plugin-chunk-split'; // https://github.com/sanyuan0704/vite-plugin-chunk-split

/** @type {import('vite').UserConfig} */
const config = {
  plugins: [
    chunkSplitPlugin(),
    sveltekit()
  ]
};

export default config;
  1. Then, do npm run build & npm run preview and check the devTool console. You should see no errors.
  2. Then add: import { goto } from '$app/navigation'; in the +page.svelte & re-run npm run build & npm run preview. You will then see the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'disable_scroll_handling')

Repository with Error Explanation:

https://github.com/migbash/sveltekit-error


Logs

Uncaught TypeError: Cannot read properties of undefined (reading 'disable_scroll_handling')

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
    Memory: 2.18 GB / 15.90 GB
  Binaries:
    Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.19.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.27)
    Internet Explorer: 11.0.19041.1566

Severity

annoyance

Additional Information

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Conduitrycommented, Sep 8, 2022

You need to provide a repo that can be cloned. As it says in the issue template for bug reports:

Explaining how to reproduce is generally not enough. It pushes the burden of creating a reproduction project onto a small set of volunteer maintainers and isn’t scalable. If no reproduction is provided, the issue will be closed.

1reaction
dummdidummcommented, Sep 8, 2022

Please provide a minimum reproducible code repo, else we don’t know how to reproduce this

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix login issues on the app? - GoTo Connect Support
Step 1 Verify the user has GoTo access · Click Users in the left sidebar and verify that the user has been added...
Read more >
Batch: The goto statement isn't working properly - Stack Overflow
Your first problem is in this line set /p input = What do you want to open? This line creates a variable called...
Read more >
GOTO command not working - TechNet - Microsoft
The problem I have is the GOTO command doesn't seem to work. My Script: ... e goto :END C:\Windows\system32>echo Sophos Not Installed.
Read more >
"if not exist" with "goto" isn't working (just skips) and "else ...
"if not exist" with "goto" isn't working (just skips) and "else" variant also not working (Windows batch file).
Read more >
goto command not working : r/Batch - Reddit
goto command not working. Hi all! I am re-learning how to use batch and I have been trying to create a sort of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found