snabbdom-pragma
snabbdom-pragma copied to clipboard
'No default export' error with TypeScript
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" ]
}
(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.