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] Clicking on a datalist with a null-coalescing value intermittently crashes the frontend #12300

Open
jmurphyct opened this issue Jan 7, 2025 · 2 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@jmurphyct
Copy link

Describe the bug

Thanks for all the work y'all put into tauri. This is infinitely easier and faster than any of the .NET ecosystem application development I've done.

I made a repo with minimal reproduction code
With the code in a solidjs project:

import { For } from "solid-js";
export function App() {

  const osList = [{name: "Edge"}, {name: "Firefox"}, {name: "Chrome"}, {name: undefined}];

  return (
    <>
      <label for="browser">Choose your browser from the list:</label>
      <input list="browsers" name="browser" id="browser"/>
      <datalist id="browsers">
        <For each={osList}>
          {(osOption) => <option value={osOption.name ?? "Uhh"}/>}
        </For>
      </datalist>
  </>
  )
}

While running in dev (npm tauri dev)
image
Clicking on the 'browser' input field sometimes crashes the frontend, closing the developer tools window and stopping rendering. Sometimes the window is all black, and sometimes it's all white.
image
It still runs in the console.

If it works once, it'll probably keep working until I close and re-open the window. It feels like it fails about 40% of the time.

Reproduction

I made a repo with minimal reproduction code.

To do it yourself:

  1. Create a new Tauri project with the solidjs frontend.
  2. Replace the contents of the App function with
const osList = [{name: "Edge"}, {name: "Firefox"}, {name: "Chrome"}, {name: undefined}];

  return (
    <>
      <label for="browser">Choose your browser from the list:</label>
      <input list="browsers" name="browser" id="browser"/>
      <datalist id="browsers">
        <For each={osList}>
          {(osOption) => <option value={osOption.name ?? "Uhh"}/>}
        </For>
      </datalist>
  </>
)
  1. Run the project through npm tauri dev
  2. Click on the "browser" input and observe the frontend crash.

Expected behavior

The datalist options should appear below the input field, as they sometimes do.

Full tauri info output

[✔] Environment
    - OS: Windows 10.0.19045 x86_64 (X64)
    ✔ WebView2: 131.0.2903.112
    ✔ MSVC:
        - Visual Studio Build Tools 2019
        - Visual Studio Professional 2022
    ✔ rustc: 1.83.0 (90b35a623 2024-11-26)
    ✔ cargo: 1.83.0 (5ffbef321 2024-10-29)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-x86_64-pc-windows-msvc (directory override for 'C:\Users\jmurphy\Documents\GitHub\broken-tauri-datalist')
    - node: 20.10.0
    - npm: 10.2.5

[-] Packages
    - tauri 🦀: 2.2.0
    - tauri-build 🦀: 2.0.4
    - wry 🦀: 0.48.0
    - tao 🦀: 0.31.1
    - @tauri-apps/api : not installed!
    - @tauri-apps/cli : 2.2.2

[-] Plugins
    - tauri-plugin-log 🦀: 2.2.0
    - @tauri-apps/plugin-log : not installed!

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:5173/
    - framework: SolidJS
    - bundler: Vite

Stack trace

No stack trace

Additional context

Fails on nightly rust toolchain too.
I cannot get any errors if I run this in browser, so I don't think it's a solidjs issue.

@jmurphyct jmurphyct added status: needs triage This issue needs to triage, applied to new issues type: bug labels Jan 7, 2025
@FabianLars
Copy link
Member

About it working in browsers, did you test Edge specifically? If not, please do so.

@jmurphyct
Copy link
Author

jmurphyct commented Jan 7, 2025

Just checked, I was unable to replicate my issue in edge.
I had originally only tried in firefox, which worked too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

No branches or pull requests

2 participants