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

typescript errors #25

Open
romamik opened this issue Dec 8, 2022 · 0 comments · May be fixed by #26
Open

typescript errors #25

romamik opened this issue Dec 8, 2022 · 0 comments · May be fixed by #26

Comments

@romamik
Copy link

romamik commented Dec 8, 2022

I've tried to set up a basic typescript project but failed.
I've just called 'npm init', 'tsc --init', 'npm install cross-shader --save', and added 'test.ts' with the code from 'readme.md'.

Looks like 'tsc' does not see anything from 'd.ts' file.
Part of the 'tsc' output:

src/index.ts:16:14 - error TS7031: Binding element 'compile' implicitly has an 'any' type.
16 xsdr.then(({ compile, ShaderFormat, ShaderStage }) => {
                ~~~~~~~

It creates '.js' file but when I try to run it, it fails. Parts of the output:

TypeError: cross_shader_1.default.then is not a function
    at Object.<anonymous> (/Users/romamik/work/tmp-shader-compiler/src/index.js:18:24)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47

Then I decided to manually edit generated '.js' file
and changed cross_shader_1.default.then to cross_shader_1.default.default.then. And after that everything worked. But that is just strange.

@romamik romamik linked a pull request Dec 8, 2022 that will close this issue
@romamik romamik changed the title typescript error, npm not updated typescript error Dec 8, 2022
@romamik romamik changed the title typescript error typescript errors Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant