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

[bug] Mac tauri v1.2.0 can not copy/paste with build mode(pnpm tauri build), but is right with using dev mode #5669

Closed
liweiv opened this issue Nov 22, 2022 · 17 comments
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@liweiv
Copy link

liweiv commented Nov 22, 2022

Describe the bug

Mac tauri v1.2.0 can not copy/paste with build mode(pnpm tauri build)but is right with using dev mode (pnpm tauri dev)

cmd +c/v is not working(v1.2.0,npm run tauri build bundle app),

This issue did not found with tauri v1.1.

Reproduction

No response

Expected behavior

No response

Platform and versions

tauri "info"

Environment
› OS: Mac OS 13.0.0 X64
› Node.js: 16.13.1
› npm: 8.1.2
› pnpm: 7.17.0
› yarn: 1.22.17
› rustup: 1.25.1
› rustc: 1.63.0
› cargo: 1.63.0
› Rust toolchain: stable-x86_64-apple-darwin

Packages
› @tauri-apps/cli [NPM]: 1.1.0 (outdated, latest: 1.2.0)
› @tauri-apps/api [NPM]: 1.1.0 (outdated, latest: 1.2.0)
› tauri [RUST]: 1.1.2,
› tauri-build [RUST]: 1.1.1,
› tao [RUST]: 0.14.0,
› wry [RUST]: 0.21.1,

App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: Vue.js

App directory structure
├─ dist
├─ node_modules
├─ public
├─ src-tauri
├─ .git
├─ .vscode
└─ src

Stack trace

No response

Additional context

No response

@liweiv liweiv added status: needs triage This issue needs to triage, applied to new issues type: bug labels Nov 22, 2022
@liweiv liweiv changed the title [bug] Mac tauri v1.20 can not copy/paste with build mode(pnpm tauri build), but is right with using dev mode [bug] Mac tauri v1.2.0 can not copy/paste with build mode(pnpm tauri build), but is right with using dev mode Nov 22, 2022
@wusyong
Copy link
Member

wusyong commented Nov 25, 2022

I tried to build a minimum example with custom protocol in release build but it's working fine.
I'll appreciate any minimum sample in tauri and even better in wry.

Edit: also examples in tauri are fine for me at least.

@FabianLars
Copy link
Sponsor Member

Maybe not all dependencies were up to date? Hard to say with the tauri info output for v1.1 when it's a 1.2 problem 😅

@vicanso
Copy link

vicanso commented Nov 27, 2022

The same situation happens to me.
Environment
› OS: Mac OS 13.0.1 X64
› Node.js: 18.6.0
› npm: 8.13.2
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.65.0
› cargo: 1.65.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
› @tauri-apps/cli [NPM]: 1.2.1
› @tauri-apps/api [NPM]: 1.2.0
› tauri [RUST]: 1.2.1,
› tauri-build [RUST]: 1.2.1,
› tao [RUST]: 0.15.6,
› wry [RUST]: 0.22.5,

@vicanso
Copy link

vicanso commented Nov 27, 2022

I found that all shortcuts don't work, for example, command + z or command + a.

@liweiv
Copy link
Author

liweiv commented Nov 29, 2022

I found that all shortcuts don't work, for example, command + z or command + a.

This problem may be found on mac OS 13 .

@errorsandwarnings
Copy link

Tauri is a generic framework for building UI. This is going to affect all the apps built on top of Tauri in a major way. These are the most basic expectations from a usable UI framework. Can we escalate it urgently and get it on top of the priority list?

@wusyong
Copy link
Member

wusyong commented Nov 30, 2022

@errorsandwarnings I'm willing to help but this issue has no reproduction steps and no expected behavior and hence I don't know how to start with.
I've tested our api examples and they are working fine to me.
I saw someone mentioned it might be intel mac issue so probably worth report to this issue if you can test those examples.

@lucasfernog
Copy link
Member

I also tested on M1 and couldn't see the issue. I'll try on Intel and older macOS too.

@lucasfernog
Copy link
Member

Works on High Sierra (VM) too :/

@errorsandwarnings
Copy link

I have tried it on MacOS Monterey and MacOS Catalina, it is there for at least according to me.

@vicanso
Copy link

vicanso commented Nov 30, 2022

WeChatWorkScreenshot_411ea882-7840-474f-a22c-65867f2f78f4

I use command + a, it doesn't work. But if the edit menu is shown, then command + a works.

WeChatWorkScreenshot_81f90638-d134-48e3-a8a1-215eb6691cfe

WeChatWorkScreenshot_d57d73f2-3e69-4e45-959f-d41241fd3bad

Environment
› OS: Mac OS 13.0.1 X64
› Node.js: 18.6.0
› npm: 8.13.2
› pnpm: Not installed!
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.65.0
› cargo: 1.65.0
› Rust toolchain: stable-aarch64-apple-darwin

Packages
› @tauri-apps/cli [NPM]: 1.2.1
› @tauri-apps/api [NPM]: 1.2.0
› tauri [RUST]: 1.2.1,
› tauri-build [RUST]: 1.2.1,
› tao [RUST]: 0.15.6,
› wry [RUST]: 0.22.5,

App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:3000/
› framework: Vue.js
› bundler: Rollup

@wusyong
Copy link
Member

wusyong commented Dec 1, 2022

First of all, thank you @vicanso for screenshots so at least there's an app I could test. And README.md is crystal clear. I really appreciate it.

I found dev build of cyberapi is working fine, but the app built by make build isn't. However, if I just test api example in tauri repo, both debug and release builds are working fine.

I hope I can still get a minimum reproducible example to share a common background on which went wrong.
Here is the reproduction steps I could think of, but it still can't reproduce the problem:

  • pnpm create tauri-app with vanila UI template
  • pnpm install
  • pnpm tauri dev
  • pnpm tauri build

I have tested the app built by pnpm tarui build but accelerators like cmd+a cmd+m are working fine for me. Could you also test if these steps works for you? And next time, please try to fill the bug report completely like this, so we don't have to back and forth and wasting too much time asking.

@wusyong
Copy link
Member

wusyong commented Dec 1, 2022

Alright, I finally found the cause which is opt-level = "z" in Cargo.toml, but opt-level="s" is fine.
Perhaps optimize level z strip down too much that the code to pass key event is removed.

@vicanso
Copy link

vicanso commented Dec 1, 2022

@wusyong Thanks for your reply.

I found that remove lto = true is also fine.

By the way, I use the config for last verion(cyberapi), it was fine. And the current version I upgraded tauri and rust. I don't know what caused it. The config is:

[profile.release]
strip = true 
lto = true
opt-level = "z"

@wusyong
Copy link
Member

wusyong commented Dec 1, 2022

We changed NSView structure to be more formal in 1.2. We used some hacky ways to add webview before.
I published a few wry patches that menu accelerator should work again in 1.2.
I would say this is typical miscompilation for optimization. Either change to lto="thin" or set opt-level="s"

@errorsandwarnings
Copy link

@wusyong Does this mean that you have found the reason why this is happening ?

@wusyong
Copy link
Member

wusyong commented Dec 9, 2022

Closed by tauri-apps/wry#782

@wusyong wusyong closed this as completed Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: macOS status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

7 participants