Open itszooper opened 1 year ago
Did some digging around. Found out its related somewhere to this file node_modules/@nuxt/content/dist/runtime/components/ContentNavigation.mjs
where it imports this method fetchContentNavigation()
. @Tahul Any idea what to do here?
import { toRefs, defineComponent, h, useSlots } from "vue";
import { hash } from "ohash";
import { useAsyncData, fetchContentNavigation } from "#imports";
export default defineComponent({
props: {
query: {
type: Object,
required: false,
default: void 0
}
},
async setup(props) {
const {
query
} = toRefs(props);
const { data, refresh } = await useAsyncData(`content-navigation-${hash(query.value)}`, () => fetchContentNavigation(query.value));
return {
data,
refresh
};
},
render(ctx) {
const slots = useSlots();
const {
query,
data,
refresh
} = ctx;
const emptyNode = (slot, data2) => h("pre", null, JSON.stringify({ message: "You should use slots with <ContentNavigation>", slot, data: data2 }, null, 2));
if (slots?.empty && (!data || !data?.length)) {
return slots?.empty?.({ query, ...this.$attrs }) || emptyNode("empty", { query, data });
}
return slots?.default ? slots.default({ navigation: data, refresh, ...this.$attrs }) : emptyNode("default", data);
}
});
@danielroe Could you please help me with this?
Completely lost as to why this is breaking. A hotfix until an official fix is released?
I haven't looked into this, but it might be fixed by https://github.com/nuxt/framework/pull/5763.
Go to: https://vinayakkulkarni.dev
If you go to the blog link & then navigate to main page by clicking on the logo on the top, the main screen/page content isn’t shown :(
Repo source code: https://github.com/vinayakkulkarni/vinayakkulkarni.dev
Using Nuxt 3 w/ Nuxt content v2 deployed to netlify
I wonder if this is linked to https://github.com/nuxt/nuxt.js/issues/14325.
I have the same issue on Vercel (using RC 10)
Same problem with local environment. I additionally tried Nuxt 3 RC 11
Environment
Nuxt CLI v3.0.0-rc.4 11:15:44 RootDir: /Users/fayaz/Opensource/logspot 11:15:45 Nuxt project info: 11:15:45
Darwin
v16.13.1
3.0.0-rc.4
yarn@1.22.19
vite
modules
,content
@nuxtjs/tailwindcss@5.1.3
,@nuxt/content@2.0.1
Build Modules:
-
Reproduction
Open this stackblitz link - https://stackblitz.com/edit/nuxt-starter-hgwgav?file=app.vue
npm install
npm run dev
- you can see it runs finenpm run generate
- You can see the error belowDescribe the bug
I am using the
useAsyncData
in my setup script to retrieve data from content folder.Additional context
Note, this is only happening when we use it with Nuxt content module. I created a different project without nuxt content and
npm run generate
worked without any issues.Logs