You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue is occurring when trying to run the dockerized the Bun application. Works outside the container, but bundling the application as part of the build processes causes the error message.
What is the expected behavior?
No response
What do you see instead?
93743 | var nodeVersionMajor = getNodeMajorVersion(nodeVersion);
93744 | var arch = process.arch;
93745 | var platform = process.platform;
93746 | var libc = getLinuxType(platform);
93747 | var sslType = getSSLType(runtime, nodeVersion);
93748 | CN_ROOT = path2.resolve(path2.dirname(__filename), "..");
^
ReferenceError: Can't find variable: CN_ROOT
at /usr/src/app/dist/index.js:93748:3
at /usr/src/app/dist/index.js:18:47
at /usr/src/app/dist/index.js:93919:108
at /usr/src/app/dist/index.js:18:47
at /usr/src/app/dist/index.js:105051:35
at /usr/src/app/dist/index.js:18:47
at /usr/src/app/dist/index.js:207982:32
Bun v1.1.27 (Linux arm64)
File: /usr/src/app/dist/index.js
Line: 93748
This file is your bundled application code, which includes the Couchbase SDK. The error occurs when the code tries to assign a value to CN_ROOT, but CN_ROOT hasn't been declared.
Given the high line number (93748) and the fact that this is in a bundled file, this code is likely part of the Couchbase SDK or one of its dependencies, not your application code directly.
The error is happening because:
The bundled code expects CN_ROOT to be a global variable.
In the context where this code is running (your Bun environment in Docker), CN_ROOT is not defined as a global variable.
This suggests that the issue is stemming from how the Couchbase SDK is being bundled and executed in your Bun environment. The SDK is written with certain assumptions about its execution environment (likely expecting to run in a standard Node.js environment), and these assumptions are not being met in your current setup.
To resolve this, we need to either:
Ensure CN_ROOT is defined globally before this code runs.
Modify how the Couchbase SDK is bundled or included in your application.
Use a version of the Couchbase SDK that's compatible with Bun and your bundling process.
Given that this is happening in a bundled file, the most direct solution would be to ensure CN_ROOT is defined globally before your application starts. However, this is a bit of a hack and might lead to other issues down the line.
A more robust solution would involve investigating how to properly integrate the Couchbase SDK with Bun, possibly by excluding it from the bundling process and loading it separately at runtime.
The text was updated successfully, but these errors were encountered:
What version of Bun is running?
1.1.27
What platform is your computer?
Darwin 23.6.0 arm64 arm
What steps can reproduce the bug?
Issue is occurring when trying to run the dockerized the Bun application. Works outside the container, but bundling the application as part of the build processes causes the error message.
What is the expected behavior?
No response
What do you see instead?
Additional information
From AI...
t
index.js.zip
he issue is originating from:
Line: 93748
This file is your bundled application code, which includes the Couchbase SDK. The error occurs when the code tries to assign a value to CN_ROOT, but CN_ROOT hasn't been declared.
Given the high line number (93748) and the fact that this is in a bundled file, this code is likely part of the Couchbase SDK or one of its dependencies, not your application code directly.
The error is happening because:
The bundled code expects CN_ROOT to be a global variable.
In the context where this code is running (your Bun environment in Docker), CN_ROOT is not defined as a global variable.
This suggests that the issue is stemming from how the Couchbase SDK is being bundled and executed in your Bun environment. The SDK is written with certain assumptions about its execution environment (likely expecting to run in a standard Node.js environment), and these assumptions are not being met in your current setup.
To resolve this, we need to either:
Ensure CN_ROOT is defined globally before this code runs.
Use a version of the Couchbase SDK that's compatible with Bun and your bundling process.
Given that this is happening in a bundled file, the most direct solution would be to ensure CN_ROOT is defined globally before your application starts. However, this is a bit of a hack and might lead to other issues down the line.
A more robust solution would involve investigating how to properly integrate the Couchbase SDK with Bun, possibly by excluding it from the bundling process and loading it separately at runtime.
The text was updated successfully, but these errors were encountered: