Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
omerman opened this issue Nov 25, 2024 · 0 comments

Comments

@omerman
Copy link

omerman commented Nov 25, 2024

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

@omerman omerman changed the title Im getting strange error on windows server Im getting strange error on windows server [TS2349: This expression is not callable.] Nov 25, 2024
@omerman omerman 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] Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant