I am wondering what are the best practices for debugging svelte applications. Most of the time I'm getting extremely ambiguous errors, or something referencing the compiled site.
This has lead me to find working with svelte rather stressful. Though I am maybe just doing it wrong?
Anyways, I started off from the official svelte ts degit template: https://svelte.dev/blog/svelte-and-typescript
and just as the detailed in the documentation I did:
npx degit sveltejs/template svelte-typescript-app
cd svelte-typescript-app
node scripts/setupTypeScript.js
And after making 2-3 components, I'm getting the following console error, my IDE shows nothing wrong (VSC with svelte plugin):
Uncaught ReferenceError: Utils is not defined
at main.ts:5:2
(anonymous) @ main.ts:5
Now this is pointing to the main.ts file, let's see what's in it:
import App from './App.svelte';
const app = new App({
target: document.body,
});
export default app;
Well, no Utils for sure and after browsing around the svelte docs, the App component shouldn't even take an argument named 'Utils'.
What am I doing wrong, how to fix it and how can I debug better with svelte.