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.

[BUG] Empty TypeScript declaration file

See original GitHub issue

Describe the bug

The package that is deployed to npm does not include anything in index.d.ts. It looks like this:

export {};
//# sourceMappingURL=index.d.ts.map

To Reproduce Steps to reproduce the behavior:

  1. npm install gotql
  2. Open node_modules/gotql/dist/index.d.ts

Current behavior

This package can’t be used in a TypeScript project.

Expected behavior

Types should be deployed within that package.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
screendrivercommented, Sep 24, 2019

It works now with 1.6.2. But the next problem is UserOptions. It is an object with a property called errorStatusCode with the description Default error code to send back to the user on error (defaults to 500). But if you look at your types it is not optional. That means that following will not compile because I do not define errorStatusCode:

await gotQl.query('https://foo.bar/graphql', query, {
  headers: {
    Authorization: `Bearer ${secret}`,
  },
});
0reactions
khaosdoctorcommented, Sep 24, 2019

@screendriver If you could please fill in another issue about this, so I can take a better look 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

"emitDeclarationOnly" + "stripInternal" produces empty *.d.ts files
this seems right to me. an output file is always generated for an input file. e.g. if you compile a file a.ts with...
Read more >
Type not being found from declaration file Typescript
So I have tried adding the namespace (namespace dropzone {}) to the declaration file, and then the error is the same. When adding...
Read more >
Type Declarations
TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes. This includes things like methods and ...
Read more >
no-useless-empty-export - TypeScript ESLint
An empty export {} statement is sometimes useful in TypeScript code to turn a file that would otherwise be a script file into...
Read more >
Declaration Files - TypeScript Deep Dive - Gitbook
d.ts or vendor.d.ts ). If a file has the extension .d.ts then each root level definition must have the declare keyword prefixed to...
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