Skip to content

"cannot find type MenuHash in this scope" - #2240

Merged
lemarier merged 3 commits into
tauri-apps:devfrom
dizda:patch-1
Jul 20, 2021
Merged

"cannot find type MenuHash in this scope"#2240
lemarier merged 3 commits into
tauri-apps:devfrom
dizda:patch-1

Conversation

@dizda

@dizda dizda commented Jul 19, 2021

Copy link
Copy Markdown
Contributor

When using:

tauri = { version = "1.0.0-beta.5", features = ["api-all", "system-tray"] }

This error is being thrown:

   Compiling tauri-runtime-wry v0.1.4
error[E0412]: cannot find type `MenuHash` in this scope
   --> /Users/j/.cargo/registry/src/github.com-1ecc6299db9ec823/tauri-runtime-wry-0.1.4/src/menu.rs:269:35
    |
269 |   custom_menu_items: &mut HashMap<MenuHash, WryCustomMenuItem>,
    |                                   ^^^^^^^^ not found in this scope
    |
help: consider importing this type alias
    |
5   | use tauri_runtime::menu::MenuHash;
    |

error: aborting due to previous error

This PR fix it.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Docs
  • New Binding Issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes. Issue #___
  • No

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@dizda
dizda requested a review from a team July 19, 2021 03:46
@lemarier

Copy link
Copy Markdown
Member

Nice catch!
Could you add a change file please

There is an example;
https://github.com/tauri-apps/tauri/blob/764bc6631806ea1196e66e8045a7ce9a45e0f7ff/.changes/tauri-wry-migrate.md

@amrbashir

Copy link
Copy Markdown
Member

@lucasfernog
Since we can have a system_tray without a menu.
I think it would be better to have 3 different feature flags.

  1. menu for all menu creation whether it is with a menu_bar or a system_tray
  2. menu_bar for the menu_bar itself and would include the menu feature flag
  3. system_tray for the tray itself

So if users just want a system_tray without a menu, they won't have to bundle the extra code for menu

@lucasfernog

Copy link
Copy Markdown
Member

I agree with you @amrbashir

@dizda
dizda requested a review from a team as a code owner July 20, 2021 02:33
@dizda

dizda commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

Updated @lemarier

@lemarier
lemarier merged commit 226414d into tauri-apps:dev Jul 20, 2021
@lemarier

Copy link
Copy Markdown
Member

Thanks @dizda we do appreciate a lot your contribution

@dizda

dizda commented Jul 20, 2021

Copy link
Copy Markdown
Contributor Author

Pleasure guys, tauri is fantastic to work with!

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.

4 participants