#Problem with image/assets and vite

2 messages · Page 1 of 1 (latest)

fluid creek
#

Hi,

I am getting the following error when I am building with assets in hybrid mode:

"fileURLToPath" is not exported by "__vite-browser-external", imported by "node_modules/astro/dist/assets/utils/metadata.js".
file: /Users/mitochondrium/nf-co.re/node_modules/astro/dist/assets/utils/metadata.js:2:9
1: import fs from "node:fs/promises";
2: import { fileURLToPath } from "node:url";
            ^
3: import imageSize from "../vendor/image-size/index.js";
4: async function imageMetadata(src, data) {
 error   "fileURLToPath" is not exported by "__vite-browser-external", imported by "node_modules/astro/dist/assets/utils/metadata.js".

I tried uncommenting every instance where I use an image asset in any component/page, but it still fails.
If I remove assets: true, from the astro config, it builds fine.

Could you give me a hint where I should continue looking for a source of this error?

paper ploverBOT
#
Quiet in here?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.