-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Nuxt 3 #5527
Comments
I reported this also on Nuxt. And there was known issue.
If you want to disable for only this problematic routes:
|
Another request |
Not much happening here since one year? My problem: https://forum.bryntum.com/viewtopic.php?t=26907 The described "workaround" with disabling the page transitions does not work at all. The related upstream issue in vue got fixed 3 weeks ago, see here: vuejs/core#9388 and here: nuxt/nuxt#13471 So if this was really the problem, we should expect it to work, but it is still not working! As soon as i do |
Looks like the upstream issue in vue and nuxt already got fixed! But i still get this error when trying to use bryntum with nuxt. So there must be an issue within the bryntum code. Or maybe @bryntum/grid-vue-3 is not using correct vue version? Is anyone working on it? Cause this issue here seems stale for quite a while? |
i found a working workaround by myself. Adding this to nuxt.config file:
fixes the "500 - The Bryntum Grid bundle was loaded multiple times by the application" issue for me. This actually has nothing to do with nuxt as this is about the vite configuration. It looks like you have an issue with your dependency management, or how you export things or how you handle mjs vs cjs.. whatever that leads to the problem of multiple loading. The optimizeDeps cleans that up for me so i can progress with my work, But you should have a look on this thing. |
Thanks for sharing your findings, we'll dig into this asap! 🙏 |
@awacode21 |
@marciogurka Most likely same approach can be for NUXT. |
is a nuxt "fix" done soon? we need it ! |
As @SergeyMaltsev said "Our components are not compatible with SSR" and that has no immediate "fix." Our components do need a browser environment to work. Therefore, if you can prevent the page with grid (or other component) from being server side rendered, all should work as expected. The problem and solution is same or similar to Next.js for which we have a section in the guide (the link is above). Although the details of disabling SSR may be different in NUXT, the principle is same. |
There's no bug in Grid component. This is how to do this: Create basic Nuxt appnpm install nuxi
npx nuxi init my-nuxt3-app
cd my-nuxt3-app Install Bryntum Gridnpm install @bryntum/grid@5.6.10
npm install @bryntum/grid-vue-3@5.6.10 Register Grid as pluginplugins/bryntum-grid.js import { defineNuxtPlugin } from '#app';
import { BryntumGrid } from '@bryntum/grid-vue-3';
import '@bryntum/grid/grid.stockholm.css';
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.vueApp.component('BryntumGrid', BryntumGrid);
}); Add to nuxt Confignuxt.config.ts // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools : { enabled : true },
plugins: [
{ src: '~/plugins/bryntum-grid.js', mode: 'client' }
],
vite : {
optimizeDeps : {
// Specify dependencies for optimization
include : ['@bryntum/grid', '@bryntum/grid-vue-3']
}
}
}); Note: Vite Create Grid client-only Componentcomponents/BryntumGridComponent.vue <template>
<client-only>
<BryntumGrid
:columns="columns"
:data="data">
</BryntumGrid>
</client-only>
</template>
<script setup>
import { ref } from 'vue';
const columns = ref([
{ field: 'name', text: 'Name' },
{ field: 'age', text: 'Age' }
]);
const data = ref([
{ name: 'John', age: 30 },
{ name: 'Jane', age: 25 }
]);
</script>
<style scoped>
/* Add any necessary styles for your grid component */
.b-grid {
/* Set the height to 100% of the viewport height */
height: 100vh;
}
</style> Add Grid client-only Componentapp.vue <template>
<div>
<h1>My Nuxt App with BryntumGrid</h1>
<BryntumGridComponent/>
</div>
</template>
<script setup>
import BryntumGridComponent from '~/components/BryntumGridComponent.vue';
</script>
<style scoped>
/* Add your styles here */
</style> Run application.
Please see attached zip. |
Forum post
bryntum-nuxt3-main.zip
The text was updated successfully, but these errors were encountered: