#heroImage Error on New Blog -> 's and getImage's src parameter must be an imported image or an URL

6 messages · Page 1 of 1 (latest)

errant bridge
#

Hello! I am a very new Astro user but I have used tools like Pelican and Hugo before.

I'm trying to create a simple blog, so I went to Asto.new and chose the blog template. I then started up my dev server like this:

npm run dev

Everything looks great, and I noticed that some blog entries already existed under src/content/blog. I therefore made a copy of first-post.md and called it third-post.md and immediately saw this error in my browser:

Image's and getImage's src parameter must be an imported image or an URL, it cannot be a string filepath. Received file://assets/blog-placeholder-3.jpg.

That's funny, because I wasn't actually changing anything. I just copied a single file and now there's a syntax error.

Why does the image path work in the original file but not the copy? Am I creating new blog entries incorrectly? Or is this an outdated template?

Thanks in advance!

#

Oh wait, ha ha. I restarted my dev server and now things are ok. 😆

Sooo...is this a common problem with the dev server? I guess I didn't expect it to give me bogus errors, nor did I expect to have to restart it to clear those bogus errors?

lunar sluice
#

It happens on occasions

errant bridge
#

Weird, ok. Thank you!

lunar sluice
#

restarting the extension server in your IDE can help too

errant bridge
#

Thank you.