Skip to content

Fix TypeScript errors in the build #47

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

Closed
leerob opened this issue Aug 25, 2021 · 2 comments
Closed

Fix TypeScript errors in the build #47

leerob opened this issue Aug 25, 2021 · 2 comments

Comments

@leerob
Copy link
Contributor

leerob commented Aug 25, 2021

The build is currently failing with:

▲  rust/ yarn build
yarn run v1.22.11
$ tsc
src/index.ts:253:9 - error TS2322: Type '{ PATH: string; RUSTFLAGS: string; TZ?: string | undefined; }' is not assignable to type 'Record<string, string>'.
  Property 'TZ' is incompatible with index signature.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

253   const rustEnv: Record<string, string> = {
            ~~~~~~~

src/index.ts:280:11 - error TS2322: Type '{ PATH: string; RUSTFLAGS: string; TZ?: string | undefined; }' is not assignable to type 'Record<string, string>'.
  Property 'TZ' is incompatible with index signature.
    Type 'string | undefined' is not assignable to type 'string'.
      Type 'undefined' is not assignable to type 'string'.

280     const rustEnv: Record<string, string> = {
              ~~~~~~~


Found 4 errors.
@icyJoseph
Copy link
Contributor

icyJoseph commented Sep 8, 2021

I fixed this by making the process.env type fit into the RustEnv type, but I reckon the project uses TS 3.x.x, and would like to upgrade it to 4.4, not sure if there are any limitations?

@leerob
Copy link
Contributor Author

leerob commented Sep 9, 2021

Thank you @icyJoseph ❤️ Created #52

@leerob leerob closed this as completed Sep 9, 2021
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

No branches or pull requests

2 participants