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.

TypeScript rejecting type definition

See original GitHub issue

Using mini-signals as an apparent sub-dependency of pixi.js in a stencil.js-based project, this line of code is causing a rather strict build configuration to fail:

https://github.com/Hypercubed/mini-signals/blob/f06098f3793e90cdd7432c8ecc62f5304eb4f45d/typings/mini-signals.d.ts#L19

Error is:

[ ERROR ]  TypeScript: ./node_modules/mini-signals/typings/mini-signals.d.ts:19:2
           An export assignment cannot be used in a module with other exported elements.

     L19:       export = MiniSignal;
     L20:  }

I can safely remove this line to circumvent this build obstacle, but I assume this isn’t commonly intended solution.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

4reactions
znorman-harriscommented, Mar 20, 2021

I came across this issue when researching how to solve the same problem that I’m having with pixi.js and this dependency. See my related issue here: https://github.com/pixijs/pixi.js/issues/7305

When I add in the workaround to my tsconfig.json file it does not resolve the problem for me.

4reactions
TheoSabattiecommented, Mar 3, 2021

Hello’,

Workaround: Add following configuration to the tsconfig.json (compilerOptions):

    "baseUrl": "./",
    "paths": {
      "mini-signals": [
        "node_modules/resource-loader/typings/mini-signals.d.ts"
      ]
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Typescript Promise rejection type - Stack Overflow
reject accepts any argument that doesn't affect type of a promise. Currently Promise cannot be typed any better. This results from the fact...
Read more >
Promise rejection type. · Issue #39680 · microsoft/TypeScript
When handling promise rejections, the type any isn't very useful. I would be useful to have the rejection have an actual type without...
Read more >
Learn How does TypeScript Promise type work? - eduCBA
rejected: This state in Promise type refers to the promise operation being failed. Example #1. TypeScript promise type Timeout asynchronous function. var ...
Read more >
Specifying type a promise rejects in defintions (d.ts)? - Reddit
In a TypeScript definition file is it possible to specify what type of error the Promise rejects with? Right now I've been helping...
Read more >
Promise.reject() - JavaScript - MDN Web Docs
reject() is generic and supports subclassing, which means it can be called on subclasses of Promise , and the result will be 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