Integrating Kepler.gl with Next.js 15 #3100
Replies: 3 comments 2 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I am encountering an problem where the Kepler.gl map is not displaying correctly when I try to run it in my application. The map area appears blank, and I see an error in the console. I'm hoping someone can help me understand the cause and how to fix it.
Problem Description:
When I navigate to the page where the Kepler.gl component is rendered, the area designated for the map remains empty. It seems like the map rendering process is failing.
Error Message:
I am seeing the following error message in my browser's:
Runtime Error
Error: ENOENT: no such file or directory, open '/Users/*/*/keplergl-app/.next/server/vendor-chunks/parquet_wasm_bg.wasm'
My project structure is roughly:
Beta Was this translation helpful? Give feedback.
All reactions