ellipsed
ellipsed copied to clipboard
ES6 import issue - Could not find a declaration file for module 'ellipsed'.
Hey,
I'm trying to import the lib the ES6 way:
import { ellipsis } from 'ellipsed';
However, I'm getting the following error.
Could not find a declaration file for module 'ellipsed'. 'project_path/node_modules/ellipsed/lib/ellipsed.js' implicitly has an 'any' type. Try
npm install @types/ellipsed
if it exists or add a new declaration (.d.ts) file containingdeclare module 'ellipsed';
[7016]
Any idea why is this happening? Thanks!
Hi @richardpap, can you tell me about your development environment? I have no trouble importing it as es6 module as described.
Just to be safe, if you're using it as es6 module, you'll need a parser like babel. Do you have any particular configuration?
Yea, sure.
I'm using webpack 4, so babel is implemented.
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0"
And this is how babel is set:
{
"presets": [
[
"env",
{
"useBuiltIns": true,
"targets": {
"browsers": [
"last 2 versions",
"safari > 8",
"not ie < 11"
]
}
}
]
]
}
Resolved as now supports TS declarations