Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

compiling with strictNullChecks: true causes compile error

$
0
0

This is a very minor issue, but it also has a very minor fix I think.

When building a TS project which includes the latest preview babylon.js typings, with the strictNullCheck:true flag set, the following error happens during compilation:

lib/babylon.d.ts(674,5): error TS2403: Subsequent variable declarations must have the same type.
 Variable 'crossOrigin' must be of type 'string | null', but here has type 'string'.

The Typescript provided lib.d.ts defines crossOrigin as 'string | null' as the error suggests. Admittedly I am not sure of the build process used for BJS, But I think that this line https://github.com/BabylonJS/Babylon.js/blob/92ab030b50fc277904a823be642755d3f0fef006/src/babylon.mixins.ts#L155

just needs to be changed to match the lib.d.ts shape ( string | null ). I've never contributed to this project, but can create a PR if you want.


Viewing all articles
Browse latest Browse all 760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>