Integrating Kepler.gl with Next.js 15 #3100
-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
Hey, not exactly a direct answer but wanted to share my experience: – Kepler examples are built using Webpack I was updating Dekart (open-source backend for Kepler.gl) to Kepler 3.x. It’s based on CRA, and I was able to get it working, though some layers did not work. Eventually, I migrated to Vite, and that worked smoothly. Will merge open-source after doing all tests. |
Beta Was this translation helpful? Give feedback.
-
Maybe it makes sense to research how to use @loaders.gl/parquet with Next.js, since we haven’t tried that in Kepler.gl. |
Beta Was this translation helpful? Give feedback.
-
|
Maybe you can try to config next.js to compile and use kepler.gl as a client side component: webpack: (config, { isServer }) => {
// Make @kepler.gl/* client-side only by aliasing them to a dummy module or false on the server side
if (isServer) {
config.resolve.alias = {
...config.resolve.alias,
'@kepler.gl/components': false,
'@kepler.gl/processors': false,
'@kepler.gl/constants': false,
'@kepler.gl/utils': false,
'@kepler.gl/layers': false,
'@kepler.gl/effects': false,
'@kepler.gl/table': false,
'@kepler.gl/deckgl-layers': false,
'@kepler.gl/reducers': false,
'@kepler.gl/styles': false,
'@kepler.gl/types': false,
'@kepler.gl/actions': false,
};
}
// Add worker-loader configuration
config.module.rules.push({
test: /\.worker\.(js|ts)$/,
use: {
loader: 'worker-loader',
options: {
filename: 'static/[hash].worker.js',
publicPath: '/_next/',
},
},
});
// Add wasm support
config.experiments = {
...config.experiments,
asyncWebAssembly: true,
};
config.module.rules.push({
test: /\.wasm/,
type: 'asset/resource',
generator: {
filename: 'static/chunks/[name][ext]',
},
});
...
}Use kepler.gl as client-only component: 'use client';
...
const KeplerGlComponent= dynamic(() => import('./components/your_keplergl_component'), {
ssr: false,
}); |
Beta Was this translation helpful? Give feedback.


Maybe you can try to config next.js to compile and use kepler.gl as a client side component: