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.

ERROR in node_modules/fuse.js/index.d.ts(12,49): error TS1144: '{' or ';' expected.

See original GitHub issue

I get a webpack compile error when I import Fuse on an Angular project

ERROR in node_modules/fuse.js/index.d.ts(12,49): error TS1144: '{' or ';' expected.
node_modules/fuse.js/index.d.ts(12,57): error TS1068: Unexpected token. A constructor, method, accessor, or property was expected.
node_modules/fuse.js/index.d.ts(12,69): error TS1005: ';' expected.
node_modules/fuse.js/index.d.ts(12,73): error TS1128: Declaration or statement expected.
node_modules/fuse.js/index.d.ts(13,7): error TS1005: ';' expected.
node_modules/fuse.js/index.d.ts(13,38): error TS1005: ',' expected.
node_modules/fuse.js/index.d.ts(13,64): error TS1005: ',' expected.
node_modules/fuse.js/index.d.ts(13,108): error TS1005: ';' expected.
node_modules/fuse.js/index.d.ts(14,7): error TS1005: ';' expected.
node_modules/fuse.js/index.d.ts(14,38): error TS1005: ',' expected.
node_modules/fuse.js/index.d.ts(14,64): error TS1005: ',' expected.
node_modules/fuse.js/index.d.ts(16,21): error TS1005: ',' expected.
node_modules/fuse.js/index.d.ts(16,39): error TS1005: '(' expected.
node_modules/fuse.js/index.d.ts(16,40): error TS1005: ',' expected.
node_modules/fuse.js/index.d.ts(16,58): error TS1005: '(' expected.
node_modules/fuse.js/index.d.ts(17,1): error TS1128: Declaration or statement expected.

It seems the Typescript is invalid. Does anyone know how to fix this? Or workaround this issue?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
chrisbendelcommented, Feb 7, 2019

This looks like it was related to the latest release (https://github.com/krisk/Fuse/pull/281/files)

Our team just ran into the same issue. Hard locking our fuse.js version in package.json fixed the issue for us. We’re using typescript version 2.7.2 by the way

Previous

"fuse.js": "^3.2.1"

Fixed

"fuse.js": "3.2.1"
1reaction
favnacommented, Mar 10, 2019

I for one see no reason whatsoever not to use TypeScript v3.3 at this point considering by ways of optional compiler flags there isnothing breaking between v2 and v3.

Furthermore any should be avoided in TypeScript wherever possible. If you’re going to use any you might as well roll back to regular JavaScript since you’re losing the very thing TypeScript meant to primarily fix and thus you’re going against the core TypeScript mentality.

I’d say this issue can be closed and people who run into this issue should update their TypeScript.


As an aside the given code example a few comments earlier is also ES5 - now this is an opinion but considering you can just set your target to ES5 and your lib in, for example, esnext there is no reason not to use powerful ES6 features like Array.forEach() and expressed arrow functions (const someFunc = () => someReturnValue)

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am getting an ERROR when compiling Angular 6 project
node_modules/@types/node/assert.d.ts(76,47): error TS1144: '{' or ';' expected. node_modules/@types/node/assert.d.
Read more >
Installation - Fuse.js
Simply download and include with a script tag. Fuse will be registered as a global variable. # CDN. For prototyping or learning purposes,...
Read more >
Error in non-existent folder #10853 - Asp.Net Zero Support
node_modules/@types/node/assert.d.ts:62:94 - error TS1144: '{' or ';' expected. 62 function strictEqual(actual: any, expected: T, ...
Read more >
fuse.js-ie11 - npm
Start using fuse.js-ie11 in your project by running `npm i fuse.js-ie11`. There is 1 other project in the npm registry using fuse.js-ie11.
Read more >
Using Fuse.js to add dynamic search to a React app
Next, we'll create a barebones index.html that contains an empty div for React to render into and a noscript message to avoid a ......
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