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

Unavailable transitive dependencies (@types/keyv) in 24.0.0-alpha.1 #7211

Closed
raksooo opened this issue Oct 24, 2022 · 9 comments
Closed

Unavailable transitive dependencies (@types/keyv) in 24.0.0-alpha.1 #7211

raksooo opened this issue Oct 24, 2022 · 9 comments
Assignees

Comments

@raksooo
Copy link

raksooo commented Oct 24, 2022

  • Electron-Builder Version: 24.0.0-alpha.1
  • Node Version: 16.16.0
  • Electron Version: 21.1.1
  • Electron Type (current, beta, nightly): current
  • Target: Windows, macOS (haven't tested Linux)

We've tried upgrading from 23.3.3 to 24.0.0-alpha.1. Sadly we were greeted by the following error:

error TS2688: Cannot find type definition file for 'keyv'.
  The file is in the program because:
    Entry point for implicit type library 'keyv'
TypeScript: 1 options error
TypeScript: emit succeeded (with errors)
[15:58:36] 'compile-scripts' errored after 17 s
[15:58:36] Error: TypeScript: Compilation failed
    at Output.mightFinish (C:\Users\oskar\mullvadvpn-app\gui\node_modules\gulp-typescript\release\output.js:130:43)
    at C:\Users\oskar\mullvadvpn-app\gui\node_modules\gulp-typescript\release\output.js:43:22
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

It looks like @types/keyv and @types/cacheable-request were deprecated and had an update which is just an empty package. @types/cacheable-request has specified the @types/keyv version to * which leads npm to use the latest version, which is empty. We tried overriding it with the following in package.json:

"override": {
  "@types/keyv": "4.2.0"
},

It did solve the issue on macOS but not on Windows for some reason.

We suspect the best solution would be for electron-rebuild to depend on got version 12+ which removes the dependency on @types/cacheable-request. Here's the dependecy tree from electron-builder down to @types/cacheable-request:

└─┬ [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └─┬ [email protected]
        └─┬ @types/[email protected]
          └── @types/[email protected]

We'll report it to electron-rebuild as well, but as long as this issue remains, the electron builder alpha is unusable unless there's another solution?

@raksooo
Copy link
Author

raksooo commented Oct 24, 2022

Reported downstream to electron-rebuild: electron/rebuild#1037

@mmaietta
Copy link
Collaborator

I had a feeling the alpha version incorporating electron-rebuild would have a few issues arise. It worked with some of my local projects, but they're more simple in configuration.
I'll see if there's a way to resolve this quickly in electron-builder, but it seems it would indeed be best resolved by upstream electron-rebuild

@mmaietta mmaietta self-assigned this Oct 25, 2022
@mmaietta
Copy link
Collaborator

mmaietta commented Oct 26, 2022

Can you try "@types/keyv": "3.1.4" in the overrides section?

I'm not sure why I can't repro this on my mac M1

@raksooo
Copy link
Author

raksooo commented Oct 31, 2022

Yes, it works with 3.1.4. I've only tested this on Windows now.

@mmaietta
Copy link
Collaborator

mmaietta commented Nov 1, 2022

Can you please test with v24.0.0-alpha.3? I've added a @types/keyv override in the pnpm dependency section. Not sure if it carries over into the npm artifact or not, or whether I need to add it directly as a dependency to force pin to.

@raksooo
Copy link
Author

raksooo commented Nov 2, 2022

Unfortunately it doesn't work.

@mmaietta
Copy link
Collaborator

mmaietta commented Nov 2, 2022

I see. Yes, I guess since it is a prod dependencies section of electron-builder, I can't provide an override in the package.json, it'll need to be overridden by your project directly.

@mmaietta
Copy link
Collaborator

mmaietta commented Nov 2, 2022

For others that find this discussion, please use the solution as described here DefinitelyTyped/DefinitelyTyped#62793 (comment)

There's no way for this to be fixed on the electron-builder side

@raksooo
Copy link
Author

raksooo commented Nov 10, 2022

@types/cacheable-request has been fixed in DefinitelyTyped/DefinitelyTyped#63097 and now 24.0.0-alpha.3 seems to be working fine 👍

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