Open Overdash opened 4 months ago
Mapbox could fix this by importing
import Keyv from "@keyvhq/core";
instead of importing
import Keyv from "keyv";
in their sdk
For future on-lookers: I worked around this by adding "@keyv/redis": "^2.8.5"
as a dependency.
I'll leave this open to let mapbox decide if they want properly fix it or ignore it.
If you are using Next.js 15 I managed to fix this with https://rc.nextjs.org/docs/app/api-reference/next-config-js/serverExternalPackages
const nextConfig = {
serverExternalPackages: ['@mapbox/mapbox-sdk'],
}
If you are using Next.js 15 I managed to fix this with https://rc.nextjs.org/docs/app/api-reference/next-config-js/serverExternalPackages
const nextConfig = { serverExternalPackages: ['@mapbox/mapbox-sdk'], }
Next.js 14 has an experimental flag for this as well:
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["@mapbox/mapbox-sdk"],
},
}
I'm having trouble using the SDK in Next.js
I'm trying to (only) use the Geocoding service to retrieve Coordinates:
But I get this error when Next.js tries to build my project with
@mapbox/mapbox-sdk
importedSeems to be coming from
keyv
incacheable-request
that's used bygot
package. I tried to override the package to the latest version, but no dice.Anyone experienced this before?