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.

Package breaks TypeScript 2.4.2 project with broken .d.ts validation

See original GitHub issue

Assuming latest TypeScript (2.4.2 atm) is globally installed (meaning, tsc command is available):

  1. mkdir test // create empty dir
  2. cd test // enter the dir
  3. yarn init -y // initialize package.json file
  4. yarn add popper.js // add popper.js
  5. tsc --init // initialize tsconfig.json file
  6. Create index.ts with:
import {BaseModifier} from 'popper.js';
  1. tsc // compile files

What is the expected behavior?

No errors should be reported.

What went wrong?

node_modules/popper.js/index.d.ts(38,5): error TS2411: Property 'shift' of type 'BaseModifier | undefined' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(39,5): error TS2411: Property 'offset' of type '(BaseModifier & { offset?: string | number | undefined; }) | undefined' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(42,5): error TS2411: Property 'preventOverflow' of type '(BaseModifier & { priority?: Position[] | undefined; padding?: number | undefined; boundariesElem...' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(47,5): error TS2411: Property 'keepTogether' of type 'BaseModifier | undefined' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(48,5): error TS2411: Property 'arrow' of type '(BaseModifier & { element?: string | Element | undefined; }) | undefined' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(51,5): error TS2411: Property 'flip' of type '(BaseModifier & { behavior?: Position[] | "flip" | "clockwise" | "counterclockwise" | undefined; ...' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(56,5): error TS2411: Property 'inner' of type 'BaseModifier | undefined' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(57,5): error TS2411: Property 'hide' of type 'BaseModifier | undefined' is not assignable to string index type 'BaseModifier & Record<string, any>'.
node_modules/popper.js/index.d.ts(58,5): error TS2411: Property 'applyStyle' of type '(BaseModifier & { onLoad?: Function | undefined; gpuAcceleration?: boolean | undefined; }) | unde...' is not assignable to string index type 'BaseModifier & Record<string, any>'.

Any other comments?

Will open a PR to fix

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
AviVahlcommented, Jul 30, 2017

yay. I barely got to comment and you already released a new version! 👍

0reactions
edcarrollcommented, Jul 30, 2017

Tricky, as the previous DT typings didn’t account for this scenario either… Unfortunately I don’t think it’s possible to get both possibilities into a single type definition file, and package.json doesn’t allow multiple type definitions.

Slightly stuck on what to do in this situation, will report back when I know more.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Package breaks TypeScript 2.4.2 project with broken .d.ts ...
Assuming latest TypeScript (2.4.2 atm) is globally installed ... Package breaks TypeScript 2.4.2 project with broken .d.ts validation #369.
Read more >
Documentation - TypeScript 2.4
Dynamic import expressions are a new feature and part of ECMAScript that allows users to asynchronously request a module at any arbitrary point...
Read more >
Serene (ASP.NET MVC - Obsolete) - Visual Studio Marketplace
Serenity is a ASP.NET MVC / TypeScript application platform which has been built on open source technologies. It aims to make development easier ......
Read more >
Npm package installation error on other partition
I'm getting this error whenever I install a package from npm on another ... /user/Personal/Projects/react/my-app/node_modules/bufferutil npm ...
Read more >
@types/gl-matrix 2.2.26-alpha on npm - Libraries.io
Test editing an existing package. You can edit the types directly in node_modules/@types/foo/index.d.ts to validate your changes, then bring the changes 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