i have a little API in express js with Typescript - Node 14 and i'm using fuse js to search a list of packages in the database. (the file name is server.ts) This is how the ts code looks:
const fuse = new Fuse (list, options)
and compiles fine but when i deploy the code in the server show an error
... fuse_js_1.default is not a constructor ...
so i go to the server.js result file and the code is like this
const fuse = new fuse_js_1.default(list, options)
if i remove .default
word, the code looks like this new fuse_js_1(list, options)
the code runs fine and works!!
Is there a way to force Typescript not to compile this line? or remove the .default automatically? I accept your comments and ideas thanks :)
Sorry, bag english :/
I found the problem, change
import Fuse from "fuse.js"
to
const Fuse = require("fuse.js")
:)