You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to get it to work is Astro, but get the following error:
error Cannot read properties of undefined (reading 'forEach')
File:
C
Stacktrace:
TypeError: Cannot read properties of undefined (reading 'forEach')
at Object.closeBundle (C:\Users\silve\Documents\web-dev\astro\astro-starter\node_modules\vite-plugin-favicons-inject\dist\cjs\index.js:70:13)
at file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/rollup/dist/es/shared/rollup.js:22748:40
at async Promise.all (index 0)
at async PluginDriver.hookParallel (file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/rollup/dist/es/shared/rollup.js:22676:9)
at async Object.close (file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/rollup/dist/es/shared/rollup.js:23750:13)
at async Promise.all (index 0)
at async Module.build (file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/vite/dist/node/chunks/dep-c842e491.js:46421:13)
at async ssrBuild (file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/astro/dist/core/build/static-build.js:134:10)
at async staticBuild (file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/astro/dist/core/build/static-build.js:54:3)
at async AstroBuilder.build (file:///C:/Users/silve/Documents/web-dev/astro/astro-starter/node_modules/astro/dist/core/build/index.js:87:5)
error Command failed with exit code 1.
astro.config.mjs
// https://astro.build/config
import { defineConfig } from 'astro/config';
// Vite plugins
import vitePluginFaviconsInject from 'vite-plugin-favicons-inject';
export default defineConfig({
vite: {
// Example: Add custom vite plugins directly to your Astro project
plugins: [
vitePluginFaviconsInject('./src/assets/logo-icon.svg'),
],
}
});
I only get the error when running astro build > astro preview.
When running astro dev it doesn't do anything, no error but also no generation/injection.
This plugin tested on vite based projects and seems to be working fine.
The problem with astro based projects may be the lack of full support to the vite configurations and hooks. This specific issue might have occurred due to the fact that astro did not call the transformIndexHtml hook which is a required stage for creating and injecting the favicons.
Without the complete support for vite configurations and hooks. I don't think it's possible to make this plugin work on astro based projects at the moment.
I'm trying to get it to work is Astro, but get the following error:
astro.config.mjs
I only get the error when running
astro build
>astro preview
.When running
astro dev
it doesn't do anything, no error but also no generation/injection.probably similar to #2
The text was updated successfully, but these errors were encountered: