farm-fe / farm

Extremely fast Vite-compatible web build tool written in Rust
https://farmfe.org
MIT License
3.83k stars 136 forks source link

[Bug Report]: Error creating WebGL context. #1422

Open niraj-khatiwada opened 6 days ago

niraj-khatiwada commented 6 days ago

Steps to reproduce

Reproduce link

No response

What is actually happening?

Homepage is crashing saying "Error creating WebGL context." image

System Info

System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
    CPU: (12) x64 AMD Ryzen 5 5600H with Radeon Graphics
    Memory: 24.84 GB / 31.20 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 20.9.0 - /run/user/1000/fnm_multishells/72523_1719064431911/bin/node
    Yarn: 1.22.22 - /run/user/1000/fnm_multishells/72523_1719064431911/bin/yarn
    npm: 10.1.0 - /run/user/1000/fnm_multishells/72523_1719064431911/bin/npm
    pnpm: 8.15.4 - ~/.local/share/pnpm/pnpm
  Browsers:
    Chrome: 126.0.6478.114
    Chromium: 124.0.6367.78
ErKeLost commented 6 days ago

Can you please provide a error specific link?

mks-h commented 3 days ago

This happens on the homepage at https://www.farmfe.org/, when the browser doesn't support (or allow) WebGL. Looking at it from a different browser I can see you have some sort of canvas overlay for the content, which is otherwise rendered from HTML.

ErKeLost commented 3 days ago

Yes, the background of the homepage uses canvas. You may need to think about how to solve this problem.

mks-h commented 3 days ago

Sorry, but I'm not willing to contribute, atm. My guess is that you could put an error boundary closer to the source of the problem, and ignore any error — so that browsers without WebGL support have a normal white background (or a similar CSS gradient background).

But a better solution might be to use CSS to achieve a similar gradient background, without any need for WebGL. As for the snow dots... There may be a way to have them, too, although they won't be random.

ErKeLost commented 3 days ago

oh I'm very sorry. I wrote my last reply wrong. I should have meant me instead of you,Your suggestion is very good I will take it and I also found some other way to replace it, again sorry

Sorry, but I'm not willing to contribute, atm. My guess is that you could put an error boundary closer to the source of the problem, and ignore any error — so that browsers without WebGL support have a normal white background (or a similar CSS gradient background).

But a better solution might be to use CSS to achieve a similar gradient background, without any need for WebGL. As for the snow dots... There may be a way to have them, too, although they won't be random.

mks-h commented 3 days ago

No problem! Nothing wrong with your reply either way.