Sveltekit Minimal installer error upon first launch (NotFoundError: No documents were returned)

Hi,

I feel a bit sorry to post this noob question but I followed the crash course video here, and when running npm run dev for the first time, instead of having the expected basic homepage I get this error from vite :

[vite:dev] NotFoundError: No documents were returned
[vite:dev]     at Client.getFirst (file:///Users/RomainG_1/Documents/%F0%9F%92%BE%20DEV/Svelte/bloomtheory/node_modules/@prismicio/client/dist/createClient.js:259:11)
[vite:dev]     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[vite:dev]     at async Client.getByUID (file:///Users/RomainG_1/Documents/%F0%9F%92%BE%20DEV/Svelte/bloomtheory/node_modules/@prismicio/client/dist/createClient.js:415:12)
[vite:dev]     at async load (eval at instantiateModule (file:///Users/RomainG_1/Documents/%F0%9F%92%BE%20DEV/Svelte/bloomtheory/node_modules/vite/dist/node/chunks/dep-Pluk1iaB.js:50501:28), <anonymous>:12:15)
[vite:dev]     at async Module.load_server_data (eval at instantiateModule (file:///Users/RomainG_1/Documents/%F0%9F%92%BE%20DEV/Svelte/bloomtheory/node_modules/vite/dist/node/chunks/dep-Pluk1iaB.js:50501:28), <anonymous>:48:18)
[vite:dev]     at async eval (eval at instantiateModule (file:///Users/RomainG_1/Documents/%F0%9F%92%BE%20DEV/Svelte/bloomtheory/node_modules/vite/dist/node/chunks/dep-Pluk1iaB.js:50501:28), <anonymous>:149:13) {
[vite:dev]   url: 'https://bloomtheory.cdn.prismic.io/api/v2/documents/search?q=%5B%5Bat%28document.type%2C+%22page%22%29%5D%5D&q=%5B%5Bat%28my.page.uid%2C+%22home%22%29%5D%5D&pageSize=1&ref=Zde3nREAACIAE0Of&routes=%5B%7B%22type%22%3A%22page%22%2C%22uid%22%3A%22home%22%2C%22path%22%3A%22%2F%22%7D%2C%7B%22type%22%3A%22page%22%2C%22path%22%3A%22%2F%3Auid%22%7D%5D',
[vite:dev]   response: undefined
[vite:dev] }

Any idea ?
Thx a lot !

Hi @romain.gle ,

Did you add/uncomment your homepage route in the route resolver?
Have you published the homepage document yet?

This may help. Let me know.

Thanks for your answer.

I did not change anything. Just installed the repo and launched npm run dev like in the video tutorial.

I noticed there was another topic that had a similar title. Would any of this help?

I ran the sveltekit minimal starter just a couple days ago and it's working for me and returning documents.

This is strange... I added the files into this github : can you you check if everything is ok ?

Hi Romain,

I assume you used the npx @slicemachine/init@latest command provided in the onboarding flow. If I look at your Prismic repository, I can see that you have a page type, which means that the init command managed to push your types. However, I can also see that you don't have any documents created.

If you open your Prismic repository, do you see anything? Or does it look like there's nothing published?

If it's true that your documents weren't pushed, it's likely a bug in Prismic — perhaps a lingering issue related to the thread that Neil linked to.

In that case, you would have two options:

  1. Simply try again. Start again and run the init command again to see if it works this time.
  2. Create the documents manually. For starters, just create a page with the UID of home, and you can proceed with the tutorial.

Let me know if that works!

Sam

Thx. I tried to rerun the npx command and it stayed the same. On prismic I have this

I'll explore a bit further for a solution and if it doesn't work I guess maybe Prismic is not for me... :sweat_smile:

@romain.gle I would recommend that you delete your project directory and start over again from scratch with a brand new Prismic repository. Let me know if you need help :slight_smile:

Sam