Skip to content

Im getting strange error on windows server [TS2349: This expression is not callable] #1237

@omerman

Description

@omerman
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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions