Closed gsheppard closed 1 year ago
Describe the bug
When initializing the client, I get TypeError: Native module not found: ../package.json. I believe it's because of this file, which has a different relative location to the package.json when compiled to CJS+ESM.
TypeError: Native module not found: ../package.json
package.json
To reproduce
import LaunchDarkly from '@launchdarkly/vercel-server-sdk' import { createClient } from '@vercel/edge-config' export const config = { matcher: '/((?!api|static|.*\\..*|_next|_vercel).*)', } export async function middleware() { const edgeClient = createClient(process.env.EDGE_CONFIG) const ldClient = LaunchDarkly.init('sdk-8e0b47f2-9422-43b0-969b-e36583872175', edgeClient) return NextResponse.next() }
Expected behavior That the client would not throw an error.
SDK version
"@launchdarkly/vercel-server-sdk": "^0.2.2", "@vercel/edge-config": "^0.1.10",
Language version, developer tools
Hello @gsheppard,
Thank you for reporting this issue. It should be fixed in 0.3.0.
Thanks, Ryan
Describe the bug
When initializing the client, I get
TypeError: Native module not found: ../package.json
. I believe it's because of this file, which has a different relative location to thepackage.json
when compiled to CJS+ESM.To reproduce
Expected behavior That the client would not throw an error.
SDK version
Language version, developer tools