mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
Fix dynamic import of child_process
This commit is contained in:
parent
1da8c6d248
commit
7033e2821d
@ -8,8 +8,8 @@ try {
|
|||||||
// Check if we're in a Node.js environment
|
// Check if we're in a Node.js environment
|
||||||
if (typeof process !== 'undefined' && process.platform) {
|
if (typeof process !== 'undefined' && process.platform) {
|
||||||
// Using dynamic import to avoid require()
|
// Using dynamic import to avoid require()
|
||||||
const childProcess = { execSync: null };
|
const { execSync: importedExecSync } = await import('child_process');
|
||||||
execSync = childProcess.execSync;
|
execSync = importedExecSync;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// In Cloudflare environment, this will fail, which is expected
|
// In Cloudflare environment, this will fail, which is expected
|
||||||
|
@ -8,8 +8,8 @@ try {
|
|||||||
// Check if we're in a Node.js environment
|
// Check if we're in a Node.js environment
|
||||||
if (typeof process !== 'undefined' && process.platform) {
|
if (typeof process !== 'undefined' && process.platform) {
|
||||||
// Using dynamic import to avoid require()
|
// Using dynamic import to avoid require()
|
||||||
const childProcess = { execSync: null };
|
const { execSync: importedExecSync } = await import('child_process');
|
||||||
execSync = childProcess.execSync;
|
execSync = importedExecSync;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// In Cloudflare environment, this will fail, which is expected
|
// In Cloudflare environment, this will fail, which is expected
|
||||||
|
@ -8,8 +8,8 @@ try {
|
|||||||
// Check if we're in a Node.js environment
|
// Check if we're in a Node.js environment
|
||||||
if (typeof process !== 'undefined' && process.platform) {
|
if (typeof process !== 'undefined' && process.platform) {
|
||||||
// Using dynamic import to avoid require()
|
// Using dynamic import to avoid require()
|
||||||
const childProcess = { execSync: null };
|
const { execSync: importedExecSync } = await import('child_process');
|
||||||
execSync = childProcess.execSync;
|
execSync = importedExecSync;
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
// In Cloudflare environment, this will fail, which is expected
|
// In Cloudflare environment, this will fail, which is expected
|
||||||
|
Loading…
Reference in New Issue
Block a user