#Access content collection frontmatter of individual post
18 messages · Page 1 of 1 (latest)
can you share the console log that should print in your terminal when you go to that route
Just a second 🙂
As i said, im a student, sorry.
If i understand correctly, the console log is in the web browser. How can i acces it when it just redirects me to an error page ?
It would be in your console output where you ran npm run dev
24:46:06 [ERROR] Article is not defined
Stack trace:
at eval (eval at instantiateModule (file:///Users/vedadtr/Desktop/%20astronovi/node_modules/vite/dist/node/chunks/dep-G-px366b.js:54755:28), <anonymous>:14:1843)
[...] See full stack trace in the browser, or rerun with --verbose.
Is this what youre looking for ?
So here <p class="text-sm text-[#222222]">By: {Article.data.author}, </p> this is where the error is. I believe here you want <p class="text-sm text-[#222222]">By: {post.data.author}, </p>
no worries and yeah hunter is right in your terminal where ever you started the dev server either bottom of vscode or terminal app but yeah on line 24
Oh god it worked
There ya go!
Thank you man so much
Sure thing. Any time
Care to explain what was the error ?
Sure. In your front matter, you were fetching your data and assigning to a variable called post but in your JSX. You were using Article which was not declared.