typesense / typesense/typesense-js

Typescript build errors

Open
#103 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
569
Forks
99
Avg merge
5h 6m
Merged PRs (30d)
2

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Webpack build with ts-loader and inspect node_modules/typesense/lib/Typesense/Documents.d.ts, especially the reported line 2 syntax errors. Compare the client import and the listed Typesense and @babel/runtime versions; done means the client transpiles without TS1005 errors in the CI/CD build.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.