vercel / ncc

Compile a Node.js project into a single file. Supports TypeScript, binary addons, dynamic requires.
https://npmjs.com/@vercel/ncc
MIT License
9.13k stars 287 forks source link

Can't import the named export... (only default export is available) #639

Open dwkfcml opened 3 years ago

dwkfcml commented 3 years ago

Hello, When I use ncc build index.js, the following problem appears:

ncc: Version 0.26.2 ncc: Compiling file index.js Error: Can't import the named export 'Assignment'.'StatusChange' (imported as 'Assignment') from default-exporting module (only default export is available) Can't import the named export 'Unit'.'Factory'.'newInstance' (imported as 'Unit') from default-exporting module (only default export is available) Can't import the named export 'Unit'.'sync' (imported as 'Unit') from default-exporting module (only default export is available) Can't import the named export 'Unit'.'mount' (imported as 'Unit') from default-exporting module (only default export is available) Can't import the named export 'Batch'.'lazyLoadSampleBatch' (imported as 'Batch') from default-exporting module (only default export is available) Can't import the named export 'Batch'.'Factory'.'newInstance' (imported as 'Batch') from default-exporting module (only default export is available) ...

Module parse failed: Unexpected token (1:5) File was processed with these loaders:

Why is this and what should i do? thanks

vn7n24fzkq commented 3 years ago

Seems a duplicate of #618