question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: detect-gpu crashes on SSR/SSG

See original GitHub issue

Problem

detect-gpu will crash on SSR/SSG.

ReferenceError: window is not defined
    at /hoge/hoge/node_modules/detect-gpu/dist/detect-gpu.umd.js:1:2591
    at /hoge/hoge/node_modules/detect-gpu/dist/detect-gpu.umd.js:1:131

I know detect-gpu depends on window object, but getGPUTier returns early without window object, so I think this ReferenceError is unexpected behavior.

Early Return https://github.com/TimvanScherpenzeel/detect-gpu/blob/23b80f1d0c02417804c4913ef0702524a56469b7/src/index.ts#L69-L75

https://github.com/TimvanScherpenzeel/detect-gpu/blob/23b80f1d0c02417804c4913ef0702524a56469b7/src/internal/deviceInfo.ts#L2

I think this line is the cause of this ReferenceError.

Reproduce

node

and

const { getGPUTier } = require("detect-gpu");

Notes

Can I fix this issue?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
TimvanScherpenzeelcommented, Nov 20, 2020

@Shinyaigeek thanks for confirming, I had little time lately to look at that MR in detail - hope to get to it soon!

1reaction
Shinyaigeekcommented, Nov 25, 2020

Thanks!! version 3.0.0 perfectly works!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug: detect-gpu crashes on SSR/SSG · Issue #52 · pmndrs/detect ...
I know detect-gpu depends on window object, but getGPUTier returns early without window object, so I think this ReferenceError is unexpected behavior.
Read more >
My PS Vita's GPU Crashed!? How I Fixed It! - YouTube
Hi guys, Tech James here,These are the 2 methods I found for fixing the PS Vita GPU crash error !This video is for...
Read more >
Manufacturers respond to GeForce RTX 3080/3090 crash to ...
NVIDIA GeForce RTX 3080/3090 graphics cards face Crash To Desktop (CTD) problems. The ongoing problems with GeForce RTX 30 series launch are reaching...
Read more >
[PC] How to Resolve GPU Crashes in Darktide
Using a G-Sync Ultrawide Monitor? · Right-click the desktop and select the 'NVIDIA Control Panel' · Select 'Help' · Select 'Debug Mode' ·...
Read more >
2070 Super - Constant BSOD crashes | NVIDIA GeForce Forums
This appears to be a typical software driver bug and is not likely to be caused by a hardware problem. The crash took...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found