I’m using Laravel, Inertia.js, and Vue.js. For CSS design, I’m utilizing Bootstrap 5 framework, and for data tables, I’m using datatables.js. Everything works fine in PWA mode, and the site functions properly. However, when I try to build with SSR using php artisan inertia:start-ssr, I encounter the following error:
import { Dashboard as Dashboard$1 } from "@uppy/vue";
^^^^^^^^^
SyntaxError: Named export 'Dashboard' not found. The requested module '@uppy/vue' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from '@uppy/vue';
const { Dashboard: Dashboard$1 } = pkg;
When I add the following settings to vite.config.js:
ssr: {
noExternal: [
/./,
],
},
After rebuilding and rerunning Inertia SSR, I encounter this error:
$$e.extend(_ext, {
^
TypeError: $$e.extend is not a function
at ssr.js (file:///F:/Projects/laravel.site.ir/bootstrap/ssr/ssr.js:72333:9)
at __require (file:///F:/Projects/laravel.site.ir/bootstrap/ssr/ssr.js:3:50)
at file:///F:/Projects/laravel.site.ir/bootstrap/ssr/ssr.js:307825:16
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async loadESM (node:internal/process/esm_loader:28:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
Could you please provide guidance on resolving this issue?
I want to simultaneously run a project that is fully functional and correctly executed by Vue.js as a PWA (Progressive Web App) and also as SSR (Server-Side Rendering) to improve its SEO ranking. However, when running php artisan inertia:start-ssr
, I encounter the mentioned error.