-
Notifications
You must be signed in to change notification settings - Fork 304
Description
import path from 'path';
//@ts-ignore
import ncc from '@vercel/ncc';
import fse from 'fs-extra';
const projectRootDir = path.join(__dirname, '..', '..', '..');
const distFolder = path.join(projectRootDir, 'dist', 'sqs-listener_build');
// Compile the code
console.log('ncc start');
const { code, map, assets } = await ncc(path.resolve(__dirname, 'main.ts'));
console.log('ncc done');
console.log('write artifact start');
await fse.writeFile(
path.join(distFolder, 'index.js'),
`${code}`,
'utf-8',
);
console.log('write artifact done');
[25.11.2024 23:55.44.059] [LOG] ncc start
[25.11.2024 23:55.44.063] [LOG] ncc: Version 0.38.3
[25.11.2024 23:55.44.063] [LOG] ncc: Compiling file index.js into CJS
[25.11.2024 23:55.45.698] [LOG] ncc: Using [email protected] (local user-provided)
[25.11.2024 23:56.41.792] [LOG] Error: [tsl] ERROR in [...]/build.ts(45,39)
TS2349: This expression is not callable.
Type 'typeof import("[...]/node_modules/@vercel/ncc/dist/ncc/index")' has no call signatures.
at [...]/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:23:2001732
at [...]/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:23:389111
at *done (eval at create ([...]/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:21:81694), :9:1)
at eval (eval at create ([...]/node_modules/@vercel/ncc/dist/ncc/index.js.cache.js:21:81694), :34:22)
The code works like a charm on my mac.. unfortunately my EC2 is windows server, it fails there, I couldnt figure out how to resolve it.
Please help,
Thank you so much