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.

Uncaught (in promise) ReferenceError: read is not defined

See original GitHub issue

We’re experiencing following errors in browser console with every client fetch():

Uncaught (in promise) ReferenceError: read is not defined
    at fetch-patch.js:36:11
(anonymous)	@	fetch-patch.js:36
Promise.then (async)		
f	@	fetch-patch.js:32
(anonymous)	@	fetch-patch.js:99
Promise.then (async)		
bh	@	utils.js:332
bl.fetchInProgress	@	fetch-patch.js:94
Promise.then (async)		
(anonymous)	@	fetch-patch.js:91
window.fetch	@	fetch-patch.js:76
u	@	areena-api.ts:64 <------------- This is where our app calls `fetch(…)`
(anonymous)	@	areena-api.ts:433
j	@	runtime.js:46
(anonymous)	@	runtime.js:275
a.<computed>	@	runtime.js:98
d	@	_async_to_generator.mjs:4
h	@	_async_to_generator.mjs:26
(anonymous)	@	_async_to_generator.mjs:30
(anonymous)	@	_async_to_generator.mjs:22
K	@	areena-api.ts:424
J	@	areena-api.ts:451
m	@	useReference.ts:20
(anonymous)	@	index.mjs:1049
i	@	index.mjs:1049
(anonymous)	@	index.mjs:1049
(anonymous)	@	index.mjs:1049
e	@	index.mjs:1049
(anonymous)	@	index.mjs:1049
(anonymous)	@	index.mjs:1049
g6	@	react-dom.production.min.js:245
hm	@	react-dom.production.min.js:262
hl	@	react-dom.production.min.js:261
ie	@	react-dom.production.min.js:260
id	@	react-dom.production.min.js:282
hX	@	react-dom.production.min.js:270
x	@	scheduler.production.min.js:14
E	@	scheduler.production.min.js:15

I debugged this far enough to discover that the error starts to happen when we import the apm-rum init function by calling:

import { init } from '@elastic/apm-rum';

In other words, the init doesn’t even have to be called for this problem to appear.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
akselinurmiocommented, Oct 21, 2022

Sorry for the long delay. It seems that the latest update to our minification module fixed the problem. Closing this issue now. Thank you for your time! 🙂

0reactions
devcorpiocommented, Sep 22, 2022

Hi @akselinurmio,

Have you found a solution for this? Ping us if you need further help

Thanks, Alberto

Read more comments on GitHub >

github_iconTop Results From Across the Web

"ReferenceError: read is not defined" when running on Node ...
I'm getting an error whenever I try to run compiled C on Node 12.1.0 behind the --experimental-modules flag. The code is compiled using ......
Read more >
ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
ReferenceError : "x" is not defined. The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
Uncaught ReferenceError: $ is not defined? - Stack Overflow
The most common reason behind the error "Uncaught ReferenceError: $ is not defined" is executing the jQuery code before the jQuery library ......
Read more >
ReferenceError: document is not defined in JavaScript
This error usually occurs when the code is running in a non-browser environment, such as in a Node.js server-side application, and does not...
Read more >
How to Fix Uncaught ReferenceError: $ is not defined in jQuery
The most common reason behind the error "Uncaught ReferenceError: $ is not defined" is executing the jQuery code before the jQuery library file...
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