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

Fix TypeScript compile error with Electron v17 #156

Merged
merged 1 commit into from Feb 13, 2022

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Feb 10, 2022

Problem

When I upgraded Electron dependency to the latest version v17, compiling electron-context-menu with TypeScript compiler caused the following error:

> tsc -p .

node_modules/electron-context-menu/index.d.ts:4:2 - error TS2305: Module '"electron"' has no exported member 'WebviewTag'.

4  WebviewTag,
   ~~~~~~~~~~


Found 1 error.

After some investigation, I realized that WebviewTag is no longer defined in electron module.

Since the compile error happens in dependency's type definition file, there is no way to fix it from a user. So this is a blocker to upgrade Electron version to the latest for me.

Fix

Instead of importing it from electron module, referring the WebviewTag class defined in Electron namespace directly worked fine.


Fixes #148

rhysd added a commit to rhysd/tweet-app that referenced this pull request Feb 10, 2022
@sindresorhus sindresorhus merged commit 07f1d94 into sindresorhus:main Feb 13, 2022
AtofStryker added a commit to cypress-io/cypress that referenced this pull request Jul 21, 2023
AtofStryker added a commit to cypress-io/cypress that referenced this pull request Jul 23, 2023
AtofStryker added a commit to cypress-io/cypress that referenced this pull request Jul 24, 2023
AtofStryker added a commit to cypress-io/cypress that referenced this pull request Jul 25, 2023
AtofStryker added a commit to cypress-io/cypress that referenced this pull request Jul 26, 2023
* chore: update electron-context-menu to 3.6.1. electron-context-menu fixed the issue we were patching in sindresorhus/electron-context-menu#156, so the patch can be deleted

* chore: update electron/get from v1 to v2. v2 drops node 12 so nothing breaking on our end

* chore: update electron-builder to ^v23.6.0 (checkTs passing)

* chore: upgrade electron packager to v16

* update electron-packager from v16 to v17

* run binary jobs for electron updates [run ci]
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 this pull request may close these issues.

Electron 15: Module '"electron"' has no exported member 'WebviewTag'
2 participants