#Astro v3 import issue

13 messages · Page 1 of 1 (latest)

silk aurora
#

Hi,

I recently upgraded my Astro project to v3 and ran into an issue.
I have an image at location: /public/images/logo.svg

In Astro v2, I was able to import public image using this:
import Logo from '/images/logo.svg?raw';

That line of code now (v3) returns undefined. What's changed?

dense trellis
#

What specific version of 3.0 are you using?

#

I'll note that importing from public is not officially supported or recommended

silk aurora
#

I am using the latest version - 3.0.13

#

I understood, but as that worked in v2, it should also work in v3. If not, that's a breaking change then, right?

dense trellis
#

It's only a breaking change if it's in a documented API 😄

#

I don't think we intentionally made a change there

silk aurora
#

Understood, I guess that it is kinda side-effect of not using recommended approach

dense trellis
#

Just tried it out, and it works for me

#

Both in dev and in prod, I get the content of the file succesfully

silk aurora
#

From the public folder?

dense trellis
#

Yeah

silk aurora
#

Hmm, interesting, I will have to investigate more deeply