krisk / Fuse

Lightweight fuzzy-search, in JavaScript
https://fusejs.io/
Apache License 2.0
17.89k stars 759 forks source link

SyntaxError: Unexpected token ... #495

Closed 312307025 closed 3 years ago

312307025 commented 3 years ago

Describe the bug

A clear and concise description of what the bug is. SyntaxError: Unexpected token ... `SyntaxError: Unexpected token ... at Object../node_modules/_fuse.js@6.4.1@fuse.js/dist/fuse.esm.js (11.js:34) at __webpack_require__ (app.js:85) at eval (employsHandle.vue?./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js??ref--12-0!./node_mod…:29) at Module../node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js?!./node_modules/_babel-loader@8.1.0@babel-loader/lib/index.js!./node_modules/_cache-loader@4.1.0@cache-loader/dist/cjs.js?!./node_modules/_vue-loader@15.9.3@vue-loader/lib/index.js?!./src/pages/database/employsManage2/employsHandle.vue?vue&type=script&lang=js& (58.js:59) at __webpack_require__ (app.js:85) at eval (employsHandle.vue:2) at Module../src/pages/database/employsManage2/employsHandle.vue?vue&type=script&lang=js& (58.js:507) at __webpack_require__ (app.js:85) at eval (employsHandle.vue:3) at Module../src/pages/database/employsManage2/employsHandle.vue (58.js:495)` ### Version The Fuse.js version where this bug is happening. fuse.js@6.4.1 Google Chrome 56.0.2924.87 ### 🔬Minimal Reproduction

There are no other steps Just use it import Fuse from 'fuse.js'

tmarklstorfer commented 3 years ago

How is the progress here? Any workarounds? I'd really like to try out fuse, but with this bug it's not usable at all. BTW I'm using typescript so my import looks like this import * as Fuse from 'fuse.js'; and i get This expression is not constructable. when i try new Fuse(data, searchOptions) UPDATE: using the common js build for now, and works really nice 👍

TeaBough commented 3 years ago

I had to downgrade to version 3.6.1.

TeaBough commented 3 years ago

import Fuse from 'fuse.js/dist/fuse.min.js' works as well

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days