typesense-js icon indicating copy to clipboard operation
typesense-js copied to clipboard

Typescript build errors

Open moarwick opened this issue 3 years ago • 2 comments

Description

We have a Typescript project, built using Webpack + ts-loader. In the client SPA, I've imported Typesense the traditional way import * as Typesense from 'typesense' which seems to work well (typings come through). The code builds and runs fine, but at build time I'm getting the following errors, so our CI/CD pipeline stops :(

ERROR in /app/node_modules/typesense/lib/Typesense/Documents.d.ts
2:12-13
[tsl] ERROR in /app/node_modules/typesense/lib/Typesense/Documents.d.ts(2,13)
      TS1005: '=' expected.
ts-loader-default_3ef1a0ebb55d0532

ERROR in /app/node_modules/typesense/lib/Typesense/Documents.d.ts
2:32-36
[tsl] ERROR in /app/node_modules/typesense/lib/Typesense/Documents.d.ts(2,33)
      TS1005: ';' expected.
ts-loader-default_3ef1a0ebb55d0532

Expected Behavior

Should transpile without errors. Is there a different way I should be importing the browser client?

Metadata

Typsense Version: "typesense": "^1.1.2" "@babel/runtime": "^7.16.7" <-- we aren't running Babel, is it needed?

OS: OSX BigSur 11.6

moarwick avatar Jan 31 '22 18:01 moarwick

@dcantu476 Any thoughts on this?

jasonbosco avatar Jan 31 '22 20:01 jasonbosco

@jasonbosco @moarwick

The first place I would check is to see what is different between the CI pipeline and your regular build steps. Maybe the CI pipeline is using a different version of typescript? Other than that, the formatting of the files is correct from what I can see.

dcantu476 avatar Feb 02 '22 02:02 dcantu476