Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Error Hosting Svelte SPA from ASP.NET Core App in IIS: Uncaught (in promise) Error: https://svelte.dev/e/lifecycle_outside_component

$
0
0

I am getting an error when trying to run a Svelte 5 (with SvelteKit) application as a SPA hosted by an ASP.NET Core application in IIS.

I am building the app using astatic adapter with a fallback file of index.html.

When I launch the app, the index.html file is loaded, I see a data call run successfully from a load function I have in a +page.ts file, however nothing renders on the screen.

If I check the console output, I see the following error:

Uncaught (in promise) Error: https://svelte.dev/e/lifecycle_outside_component

Note: Routing seems to be working so I don't think that's the issue. If I make a dynamic route, like /my-route, I get the same error as above. However, if I try a route that doesn't exist, like /fake-route, in the console output I see "gn: Not found: /fake-route", followed by the same lifecycle error.

Also, the app runs fine in dev mode through Vite. It's only when it's run from the ASP.NET app that this issue occurs.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>