Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Labs/Select] Errors in popper.js typings #1527

Closed
slavasitnikov opened this issue Sep 6, 2017 · 6 comments
Closed

[Labs/Select] Errors in popper.js typings #1527

slavasitnikov opened this issue Sep 6, 2017 · 6 comments

Comments

@slavasitnikov
Copy link

Bug report

  • Package version(s): typescript: 2.5.2, blueprintjs/labs: 0.8.0

Steps to reproduce

https://gist.github.com/slavasitnikov/887e240be9b08b35d0b67516d4e6ce08

npm i
./node_modules/.bin/tsc

Actual behavior

Compilation errors:

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 'Base
Modifier & 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 'BaseModif
ier & Record<string, any>'.

It seems it is the same bug here: floating-ui/floating-ui#414

@DrewDennison
Copy link
Contributor

I fixed (for now) by removing strict null checks from TS and got it to compile in case that helps anyone.

@jtheisen
Copy link

This is fixed in popper.js 1.12.5 and greater.

It's this issue.

@jtheisen
Copy link

As a temporary fix, update this line in your index.d.ts.

@thelastnode
Copy link

Looks like this is fixed in v1.11.1 as well. That might be an easier version bump to get out a quick fix?

@mgambati
Copy link

mgambati commented Oct 5, 2017

Can this be fixed on next labs 0.12.0 release?

@adidahiya
Copy link
Contributor

adidahiya commented Nov 7, 2017

Hey, I figured this out. webpack 3 defaults to loading the "module" entry from package.json, which is a breaking change since webpack 1. I got this working with the latest popper.js in my PR here: 4c141b9

Should be shipped in the next release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants