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.

Web APIs throws "no-undef" errors

See original GitHub issue

No matter wwhich of the new Web APIs is used, they all throw an error.

let accelerometer = new Accelerometer()

// See error in screenshot 

I know that I can use eslint-disable-next-line, however, I thought I share that observation here - maybe it is not even a eslint-related problem and I misunderstand something - in which case I’d be happy to learn about my shortcomings.

Thank you!

Bildschirmfoto 2021-04-28 um 18 24 48

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
aladdin-addcommented, Apr 29, 2021

I’m not very familiar with Accelerometer, is it a new added web api?(maybe it has not been supported yet)

2 ways:

1reaction
aladdin-addcommented, Apr 28, 2021

to allow web APIs, please set the browser env:

{
  "env": {"browser": true}
}

refs: https://eslint.org/docs/user-guide/configuring/language-options#specifying-environments

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-undef - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Web API Error Handling: How To Make Debugging Easier
Understand the problem of error handling from two angles: the what and the how. Make debugging easier with web API error handling best ......
Read more >
'MediaMetadata' is not defined no-undef and ... - Stack Overflow
Above code prints Browser supports MediaMetadata API , but it continuously throwing error MediaMetadata is not defined .
Read more >
Handle errors in ASP.NET Core web APIs - Microsoft Learn
This article describes how to handle errors and customize error handling with ASP.NET Core web APIs. Developer Exception Page.
Read more >
TransformStreamDefaultController.error() - Web APIs | MDN
The error() method of the TransformStreamDefaultController interface errors both sides of the stream. Any further interactions with it will ...
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