TypeScript typings have no default export
See original GitHub issueReplicated version:
3.11.0
4.1.3
Error message when attempts to build a TypeScript project that uses neon-js
node_modules/@cityofzion/neon-core/lib/logging.d.ts:1:8 - error TS1192: Module '"/Users/travis/ProjectGit/rockacola/neo-js/node_modules/@types/loglevel/index"' has no default export.
1 import loglevel from "loglevel";
~~~~~~~~
node_modules/@cityofzion/neon-core/typings/elliptic.d.ts:2:10 - error TS1192: Module '"/Users/travis/ProjectGit/rockacola/neo-js/node_modules/@types/bn.js/index"' has no default export.
2 import BN from "bn.js";
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
error TS1192: Module '" A.module"' has no default export
This was a simple error. It occurred due to the missing {} around the module name in the import statement itself.
Read more >Typescript typings have no default export · Issue #533 - GitHub
In version 6.2.1 the tsc compiler complains that 'react-day-picker' has no default export. ... // **\node_modules\react-day-picker\types\index.d.
Read more >TSConfig Option: allowSyntheticDefaultImports - TypeScript
This option brings the behavior of TypeScript in-line with Babel, where extra code is emitted to make using a default export of a...
Read more >error TS1192: Module has no default export [Solved] - SPGuides
In this reactjs tutorial, we will discuss how to fix an error, error TS1192: Module has no default export. The solution will fix...
Read more >Avoid Export Default - TypeScript Deep Dive - Gitbook
Avoid Export Default · If you refactor Foo in foo.ts it will not rename it in bar.ts . · If you end up...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I dug more into this and realise this is an ES6 vs CJS import issue. This is because of how typescript modules are coupled tightly to ES6 modules but the modules we are consuming are CJS modules, resulting in a breakage of types. You will have to enable
esModuleInterop
in yourtsconfig.json
and yourtsc
should pass in neo-js.Closing ticket as it is no longer believed to be a concern of neon-js