`Goto` not working
See original GitHub issueDescribe 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
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
-
navigate into the my-app directory
-
install
vite-plugin-chunk-splitfrom:npm i vite-plugin-chunk-split -
update the
vite.config.jsto:
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;
- Then, do
npm run build&npm run previewand check thedevToolconsole. You should see no errors. - Then add:
import { goto } from '$app/navigation';in the+page.svelte& re-runnpm 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:
- Created a year ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You need to provide a repo that can be cloned. As it says in the issue template for bug reports:
Please provide a minimum reproducible code repo, else we don’t know how to reproduce this