Closed xarthurx closed 1 year ago
Yeah this is just because the AGGrid package hasn't been set up for SSR. Like if you turn ssr: false in your SolidStart options it would work.
I don't know if AG-Grid has browser-specific dependencies that would require it to be loading only there but I suspect it might. But in anycase in the current state it is packaged in a way that will work in SSR.
To do so it would have to have a "solid" export that would point at the source code so we could compile it for ssr mode as both the client and server builds would be different than what is packaged there. And example package that shows how to bundle this is https://github.com/solidjs-community/rollup-preset-solid.
If your desire is for it to render on the server your best bet is to request them to support SSR (not sure if they do). If the desire is to have it not render during server side in a SSR setup there are some patterns for doing that in SolidStart and some features we are working on to lazy load it only into the client.
Yeah this is just because the AGGrid package hasn't been set up for SSR. Like if you turn ssr: false in your SolidStart options it would work.
I don't know if AG-Grid has browser-specific dependencies that would require it to be loading only there but I suspect it might. But in anycase in the current state it is packaged in a way that will work in SSR.
To do so it would have to have a "solid" export that would point at the source code so we could compile it for ssr mode as both the client and server builds would be different than what is packaged there. And example package that shows how to bundle this is https://github.com/solidjs-community/rollup-preset-solid.
If your desire is for it to render on the server your best bet is to request them to support SSR (not sure if they do). If the desire is to have it not render during server side in a SSR setup there are some patterns for doing that in SolidStart and some features we are working on to lazy load it only into the client.
Thank you for the reply. I'm actually a bit new to solid and totally new to SolidStart. Silly question... where can I turn the option "ssr:false" off? I browsed the doc, but don't see a setting file...
Ah, never mind. I created a new repo with the guild, and found out:
Yeah this is just because the AGGrid package hasn't been set up for SSR. Like if you turn ssr: false in your SolidStart options it would work.
I don't know if AG-Grid has browser-specific dependencies that would require it to be loading only there but I suspect it might. But in anycase in the current state it is packaged in a way that will work in SSR.
To do so it would have to have a "solid" export that would point at the source code so we could compile it for ssr mode as both the client and server builds would be different than what is packaged there. And example package that shows how to bundle this is https://github.com/solidjs-community/rollup-preset-solid.
If your desire is for it to render on the server your best bet is to request them to support SSR (not sure if they do). If the desire is to have it not render during server side in a SSR setup there are some patterns for doing that in SolidStart and some features we are working on to lazy load it only into the client.
FYI, ag-grid developer said they will not support ssr: https://github.com/ag-grid/ag-grid/issues/6929
There's another questions related to this issue:
version 0.2.26
adapter static
file:///C:/Users/xar/source/docRepo/ddmRemake/node_modules/solid-start-static/index.js:26
if(!config?.solidOptions?.ssr) throw new Error('solid-start-static needs ssr to be enabled for pre-rendering routes at build time');
When I build the site to a static site, I got the above error...
Does it mean that with ssr
disabled, I cannot generate a static site?
@ryansolid
I'm going to continue this conversation in the SolidStart issue.
Describe the bug
Trying to use AgGrid inside solidjs by:
When refreshing my
customModule.jsx
, the main webpage shows the error.Your Example Website or App
https://github.com/xarthurx/soildStartTest
Steps to Reproduce the Bug or Issue
npm init solid@latest
npm install ag-grid-solid
npm run dev
to start the engine -- everything works correctlyimport AgGridSolid from "ag-grid-solid";
tosrc/routes/index.jsx
Expected behavior
Everything should be imported correctly.
Screenshots or Videos
No response
Platform
Additional context
When using
to initialize the project and do the same test, there seems no issue. So I guess this might be an issue related to
solid-start
, notsolid
.