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

'No default export' error with TypeScript #36

Open
mrehayden1 opened this issue Aug 10, 2018 · 1 comment
Open

'No default export' error with TypeScript #36

mrehayden1 opened this issue Aug 10, 2018 · 1 comment

Comments

@mrehayden1
Copy link

When importing snabbdom-pragma like so into my project

import Snabbdom from 'snabbdom-pragma';

TypeScript throws the following error

TS1192: Module '"<snip>/snabbdom-pragma/snabbdom-pragma"' has no default export.

The only way to get it to compile without errors is as a qualified import, which is a bit warty.

import * as Snabbdom from 'snabbdom-pragma';

My tsconfig.json:

{
  "compilerOptions": {
    "allowJs": true,
    "jsx": "React",
    "jsxFactory": "Snabbdom.createElement",
    "module": "es6",
    "moduleResolution": "node",
    "noImplicitAny": true,
    "outDir": "www/js",
    "sourceMap": true,
    "strict": true,
    "target": "es5"
  },
  "exclude": [ "node_modules" ]
}
@Swizz
Copy link
Owner

Swizz commented Aug 16, 2018

(Back in business after a break)

I am pretty sure it is because I use an old way to define default export in the DTS file.
I was not so confident about Typescript when I was working on this projet.

I will take a look shorty.

Thank you for the report.

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

2 participants