Unable to compile with typescript 2.4.2 and "strictNullChecks": true,
See original GitHub issueHello,
I’m using popper.js with typescript (being imported from @blueprintjs/labs node module) and when I have "strictNullChecks": true,
I get the error below. If I change my setting to "strictNullChecks": false,
then everything compiles. Let me know if I should report this to blueprintjs
but figured I would start here for now. @giladgray might know what’s up. I did a full rm -rf node_modules
and yarn install
before seeing this error.
yarn build v0.27.5
$ react-scripts-ts build
Creating an optimized production build...
ts-loader: Using typescript@2.4.2 and /Users/dennison/projects/echelon/echelon-web/tsconfig.json
Failed to compile.
/Users/dennison/projects/echelon/echelon-web/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>'.
/Users/dennison/projects/echelon/echelon-web/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>'.
/Users/dennison/projects/echelon/echelon-web/node_modules/popper.js/index.d.ts
(42,5): error TS2411: Property 'preventOverflow' of type '(BaseModifier & { priority?: ("bottom" | "top" | "left" | "right")[] | undefined; padding?: numbe...' is not assignable to string index type 'BaseModifier & Record<string, any>'.
/Users/dennison/projects/echelon/echelon-web/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>'.
/Users/dennison/projects/echelon/echelon-web/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>'.
/Users/dennison/projects/echelon/echelon-web/node_modules/popper.js/index.d.ts
(51,5): error TS2411: Property 'flip' of type '(BaseModifier & { behavior?: ("bottom" | "top" | "left" | "right")[] | "flip" | "clockwise" | "co...' is not assignable to string index type 'BaseModifier & Record<string, any>'.
/Users/dennison/projects/echelon/echelon-web/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>'.
/Users/dennison/projects/echelon/echelon-web/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>'.
/Users/dennison/projects/echelon/echelon-web/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>'.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Unable to compile with typescript 2.4.2 and "strictNullChecks ...
Hello, I'm using popper.js with typescript (being imported from @blueprintjs/labs node module) and when I have "strictNullChecks": true, ...
Read more >strictNullChecks - TSConfig Option - TypeScript
When strictNullChecks is true , null and undefined have their own distinct types and you'll get a type error if you try to...
Read more >Two errors: 1.Unable to compile TypeScript 2.Process exited ...
For the first issue: npm install ts-node --save-dev npm install -g typescript --save-dev. For the second issue add: chromeOnly:true ...
Read more >Announcing TypeScript 2.3 - Microsoft Developer Blogs
Today we're excited to bring you our latest release with TypeScript 2.3! For those who aren't familiar, TypeScript is a superset of ...
Read more >Custom Angular Modules :: A Guide on Creating, Publishing ...
Use the Typescript command to create a tsconfig.json file for the application. The configuration information in this file will be used to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @MrFrankel
"skipLibCheck": true,
did the trick. TIL@FezVrasta, no, it will simply not check them for internal errors, obviously libraries that support types should not have errors in them, but as consumers we cant have our build’s fail due to a TS error