I am trying to read in the contents of a text file and display it in my svelte application. I am getting a 404 console error that says the file cannot be found even though I know the path is correct. Can anyone help with this please?
<script>
let text;
import { onMount } from 'svelte';
onMount(()=> {
loadItems();
});
const loadItems = async()=>{
const response = await fetch ("aboutSimwb.txt");
text = await response.text();
};
</script>
<div class = "scrollable-container">
<slot>
<p>
{text}
</p>
</slot>
</div>
<style>
.scrollable-container{
height: 300px;
overflow-y: scroll;
border: 1px solid #ccc;
}
</style>