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
MarkBoots2mo 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
FakerOP2mo ago
hmm vanilla js, yeah wait
Faker
FakerOP2mo ago
hmm browser extension, like a extension downloaded from google library for eg?
MarkBoots
MarkBoots2mo ago
for me it seems to just work. What device/browser do you use?
Faker
FakerOP2mo ago
I'm using google chrome
MarkBoots
MarkBoots2mo ago
i tested in chrome, edge and firefox on windows (the 'meta' was my windows key to screengrab)
No description
Faker
FakerOP2mo ago
hmm strange, it's not the first time I'm having this error, the code works but I get this error
MarkBoots
MarkBoots2mo ago
can you screenshot the error from the devtools console
Faker
FakerOP2mo ago
yep wait
snxxwyy
snxxwyy2mo ago
Perhaps it’s something to do with not having defer applied?
MarkBoots
MarkBoots2mo ago
then it wouldnt find the element to attach the eventlistener too, but that doesnt seem to be the issue
Faker
FakerOP2mo 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
MarkBoots2mo ago
grammerly is an extenstion I suppose, yes
ἔρως
ἔρως2mo 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
FakerOP2mo ago
hmm here is what I obtain when I click on one of the link
Faker
FakerOP2mo ago
No description
ἔρως
ἔρως2mo ago
that's not being included by codepen, so try to disable grammarly and see if it still happens
Faker
FakerOP2mo ago
yeah the problem was with the extension
ἔρως
ἔρως2mo ago
maybe they will fix it at some point
Faker
FakerOP2mo ago
ok ok ty !!
Want results from more Discord servers?
Add your server