compromise_1.default is not a function
See original GitHub issueThis is what I did:
npm i ts-node
npm i typescript
npm i compromise
Then I pasted the node module example:
// script.ts
import nlp from 'compromise'
var doc = nlp('London is calling')
doc.verbs().toNegative()
Then did:
ts-node script.ts
And I got this error:
TypeError: compromise_1.default is not a function
The same happened when I was working in a VS Code extension.ts
file. (So maybe Compromise has problems running in TypeScript files?). Compromise worked well after I changed import nlp from 'compromise'
to const nlp = require('compromise')
.
Note: These are the versions of the packages.
"compromise": "^12.3.0",
"ts-node": "^8.6.2",
"typescript": "^3.7.5"
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Typescript/babel import causing "_1.default is not a function"
I have managed to fix it by adding "esModuleInterop": true to tsconfig.json . https://www.typescriptlang.org/docs/handbook/compiler-options.
Read more >TypeError: dayjs_1.default is not a function · Issue #475 - GitHub
When updating the dayjs package from 1.8.0 to 1.8.3, I'm getting this error. I changed my import from import * as dayjs from...
Read more >fda: Functional Data Analysis
derivative must not exceed the order. The default derivative is 0, meaning that the basis functions themselves are evaluated. returnMatrix.
Read more >Calling Apex function results in a "default(...).this is not a ...
I found an answer, but wanted to leave this up in case it frustrates anyone else. I updated my VS Code LWC Extension...
Read more >Therapeutics Clinical Implementation Guide - ASPR
Sufficient information is not available to assess renal and hepatic function. • Sufficient information is not available to assess for a potential drug ......
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
@Drache93 Ah great, thanks!
@alexcheninfo Glad I could help!