Describe the bug
The vue component Font-Awesome cannot find the icons during ssr. It works fine in the browser.
Response from the server: (Where underlined in yellow there should be an icon)
My ssr.js:
import { createSSRApp, h } from "vue";
import { createInertiaApp } from "@inertiajs/vue3";
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
import createServer from "@inertiajs/vue3/server";
import { renderToString } from "@vue/server-renderer";
import { ZiggyVue } from '../../../vendor/tightenco/ziggy/dist/vue.m'
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
import { library } from "@fortawesome/fontawesome-svg-core";
import {
faArrowUpRightFromSquare,
faCircleNotch,
faMagnifyingGlass,
faPhone,
faRightToBracket
} from "@fortawesome/free-solid-svg-icons";
import.meta.glob([
'../images/**',
'../fonts/**',
]);
library.add(faRightToBracket, faCircleNotch, faPhone, faMagnifyingGlass, faArrowUpRightFromSquare);
createServer((page) =>
createInertiaApp({
page,
render: renderToString,
resolve: (name) => resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
setup({ App, props, plugin }) {
return createSSRApp({ render: () => h(App, props) })
.component('font-awesome-icon', FontAwesomeIcon)
.use(plugin)
.use(ZiggyVue, {
...page.props.ziggy,
location: new URL(page.props.ziggy.location),
});
}
})
);
Expected behavior
Rendering icons on the server.
Desktop (please complete the following information):
Describe the bug The vue component Font-Awesome cannot find the icons during ssr. It works fine in the browser. Response from the server: (Where underlined in yellow there should be an icon)
My ssr.js:
Expected behavior Rendering icons on the server.
Desktop (please complete the following information):
Additional context composer.json:
package.json:
I hope for your help 😊