0

I use ES6 modules in my code but I cannot import Fuse on the client. In node, everything works, but in the browser (Firefox developer edition 66.0b4 on Linux), this fails (the code is in the ./js folder):

import Fuse from "../node_modules/fuse.js/dist/fuse.js";
...
new Fuse(items,options);

The error is "SyntaxError: import not found: default". Can this be fixed or is it impossible to use Fuse as an ES6 module in the browser?

My package.json contains the dependency "fuse.js": "^3.3.0". I don't use transpilation at this time.

P.S.: It works with the transpiled code, but I develop without transpilation.

Konrad Höffner
  • 8,510
  • 11
  • 50
  • 92

0 Answers0