-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
Description
SDK Language
TypeScript / Node.js SDK (@composio/core)
SDK Version
@composio/core@0.3.1
Runtime Environment
Cloudflare workers
Environment
Cloudflare Worker
Describe the Bug
@composio/core@0.3.1 fails in Cloudflare Workers with:
TypeError: The argument 'path' must be a file URL object,
a file URL string, or an absolute path string. Received 'undefined'
Steps to Reproduce
import { Composio } from '@composio/core';
const composio = new Composio({ apiKey: 'xxx' });
// Fails in Cloudflare WorkersError Output / Stack Trace
TypeError: The argument 'path' must be a file URL object,
a file URL string, or an absolute path string. Received 'undefined'
at createRequire (node:module)Reproducibility
- Always reproducible
- Intermittent / Sometimes
- Happened once, can’t reproduce
Additional Context or Screenshots
In Workers, import.meta.url is undefined.
Possible Workaround
Set platform: 'neutral' in ts/packages/core/tsdown.config.ts:
export default defineConfig({
entry: ['src/index.ts'],
format: ['esm', 'cjs'],
dts: true,
clean: true,
minify: false,
outDir: 'dist',
tsconfig: './tsconfig.build.json',
+ platform: 'neutral',
onSuccess() {
console.info('🙏 Build succeeded!');
},
});