Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true. . .

Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received Hello guys, sorry to disturb you all, can someone explain what this error is all about please, I didn't understand why I obtain this error, here is my script:
const textBox = document.querySelector('#textBox');

textBox.addEventListener('keydown', (event) => {
console.log(`you pressed: ${event.key}`);
})
const textBox = document.querySelector('#textBox');

textBox.addEventListener('keydown', (event) => {
console.log(`you pressed: ${event.key}`);
})
21 Replies
MarkBoots
MarkBoots3w ago
this bit doesn't seem to have any issues, think something else is interacting with it. are you using a framework or just vanilla j? It could also be a browser extension that interferes can you recreate the problem in a codepen?
Faker
FakerOP3w ago
hmm vanilla js, yeah wait
Faker
FakerOP3w ago
hmm browser extension, like a extension downloaded from google library for eg?
MarkBoots
MarkBoots3w ago
for me it seems to just work. What device/browser do you use?
Faker
FakerOP3w ago
I'm using google chrome
MarkBoots
MarkBoots3w ago
i tested in chrome, edge and firefox on windows (the 'meta' was my windows key to screengrab)
No description
Faker
FakerOP3w ago
hmm strange, it's not the first time I'm having this error, the code works but I get this error
MarkBoots
MarkBoots3w ago
can you screenshot the error from the devtools console
Faker
FakerOP3w ago
yep wait
snxxwyy
snxxwyy3w ago
Perhaps it’s something to do with not having defer applied?
MarkBoots
MarkBoots3w ago
then it wouldnt find the element to attach the eventlistener too, but that doesnt seem to be the issue
Faker
FakerOP3w ago
hmm I didn't obtain the error this time but I guess you were right when you said that may be browser extensions were inferering, I believe the grammerly browser extension can intefere
No description
MarkBoots
MarkBoots3w ago
grammerly is an extenstion I suppose, yes
ἔρως
ἔρως3w ago
https://www.grammarly.com/ grammarly was a good extension to help fix grammar issues that's probably what's causing the error just check the path of the grammarly.js file path, by clicking on it
Faker
FakerOP3w ago
hmm here is what I obtain when I click on one of the link
Faker
FakerOP3w ago
No description
ἔρως
ἔρως3w ago
that's not being included by codepen, so try to disable grammarly and see if it still happens
Faker
FakerOP3w ago
yeah the problem was with the extension
ἔρως
ἔρως3w ago
maybe they will fix it at some point
Faker
FakerOP3w ago
ok ok ty !!
Want results from more Discord servers?
Add your server