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

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

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

danielj247
Copy link
Contributor

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.

Add optional chain to navigation.userAgent incase userAgent is undefined
Copy link

netlify bot commented Oct 10, 2024

Deploy Preview for vue-devtools-docs ready!

Name Link
🔨 Latest commit 7b4be22
🔍 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.

@webfansplz webfansplz changed the title fix: add optional chain to isInElectron env fix(shared): add optional chain to isInElectron env Oct 10, 2024
@webfansplz webfansplz merged commit 60dea66 into vuejs:main Oct 10, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants