Akryum / Akryum/floating-vue

Cannot run in SSR/Vue 3 due to floating-vue components

Open
#1,056 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3.5k
Forks
341
Avg merge
14m
Merged PRs (30d)
8

Description

Hello,

I am using the package inside a Laravel / InertiaJS project.

Inside the `vite.config.js` file, I exclude the package as I need it only on the client-side.

```
ssr: {
noExternal: [
// ...
'floating-vue',
// ...
]
},
```

When I run the inertiajs SSR command via `php artisan inertia:start-ssr`, then I start the app, I get the following error

```
ReferenceError: Element is not defined
at file:///var/www/html/bootstrap/ssr/assets/Navigation-4196422e.js:1090:30
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
at async j (file:///var/www/html/node_modules/@inertiajs/vue3/dist/index.esm.js:1:5861)
at async Server. (file:///var/www/html/node_modules/@inertiajs/core/dist/server.esm.js:1:527)
```

At line-1095 inside the Navigation component, is this code:

```
$t = defineComponent({
name: "VPopperWrapper",
components: {
Popper: nt,
PopperContent: Q
},
mixins: [
Z,
J("finalTheme")
],
props: {
// ...
container: {
type: [String, Object, Element, Boolean], **// Line 1095**
default: void 0
},
boundary: {
type: [String, Element],
default: void 0
},
```

Any idea how to make this work?

Thanks
Bill

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.