question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript typings have no default export

See original GitHub issue

Replicated 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:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
snowypowerscommented, Nov 19, 2018

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 your tsconfig.json and your tsc should pass in neo-js.

0reactions
rockacolacommented, Nov 23, 2018

Closing ticket as it is no longer believed to be a concern of neon-js

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found