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.

compromise_1.default is not a function

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
colinricardocommented, Apr 27, 2020

@Drache93 Ah great, thanks!

1reaction
Drache93commented, Jan 28, 2020

@alexcheninfo Glad I could help!

Read more comments on GitHub >

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

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