The site has suddenly stopped working, even though the code has not changed. It’s to do with composables in Nuxt3, specifically, useSanityQuery which comes from the nuxtjs/sanity module.
Site is https://main--museums-aotearoa.netlify.app/
this is the main branch deploy that shows the error, I’ve rolled production back to a build that is currently working.
I’m getting an error: [nuxt] error caught during app initialization ReferenceError: useSanityQuery is not defined
It seems that it can’t find useSanityQuery which is a nuxt composable, provided by nuxtjs/sanity I’ve installed it according to the docs, and generally you shouldn’t need to import useSanityQuery as the composable should be autoimported.
I’ve tried a few things, most relevant are
-
directly importing, this failed at build time:
import { useSanityQuery } from "#imports";
-
updating netlify.toml to include
[functions]
included_files = [
"./node_modules/@sanity/client/**/*"
]
Any help much appreciated!