Skip to content

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

Open

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 typescript@5.5.4 (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

Activity

  1. changed the title [-]Im getting strange error on windows server[/-] [+]Im getting strange error on windows server [TS2349: This expression is not callable.][/+] on Nov 25, 2024
  2. changed the title [-]Im getting strange error on windows server [TS2349: This expression is not callable.][/-] [+]Im getting strange error on windows server [TS2349: This expression is not callable][/+] on Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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