vuejs / devtools

⚙️ Browser devtools extension for debugging Vue.js applications.
https://devtools.vuejs.org/
MIT License
1.7k stars 122 forks source link

fix(shared): add optional chain to `isInElectron` env #629

Closed danielj247 closed 1 month ago

danielj247 commented 1 month ago

Description

I have set-up a laravel, inertia and vue project and integrated devtools-next but kept getting errors on running vite:

failed to load config from {project dir}/vite.config.js
error when starting dev server:
TypeError: Cannot read properties of undefined (reading 'toLowerCase')

Solution

The first conditional in isInElectron checks if the navigator class exists, it does but it is empty - so the userAgent is undefined. I've added an optional chain to the end of the userAgent to ensure it's existence.

netlify[bot] commented 1 month ago

Deploy Preview for vue-devtools-docs ready!

Name Link
Latest commit 7b4be22fbc45de178b2a54efbebe05d4edfc5822
Latest deploy log https://app.netlify.com/sites/vue-devtools-docs/deploys/6707e04fbb78c4000853ad2e
Deploy Preview https://deploy-preview-629--vue-devtools-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.