document.arrive is not a function, error
Fix what?
Sounds like you're using a library that adds document.arrive so apparently the library didn't load.
Test on this url https://produto.mercadolivre.com.br/MLB-1198076115-pacote-c-10-conector-rj45-cat5e-banho-de-ouro-cabo-rede-_JM#position=2&type=item&tracking_id=b79be317-129d-42a7-810f-91c1a375c8d4
// ==UserScript==
// @name arrive is not a function bug
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author hacker09
// @include *
// @require https://greasyfork.org/scripts/21927-arrive-js/code/arrivejs.js
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
//The arrive library will wait for an element, then run the async function, in this case the arrive library will wait for the #float-container element to be created,as soon as the element is created the async function will run
function Matematica(){
alert('This is just a test\n The arrive library detected the element and executed the Matematica function SUCESSFULLY')
}
document.arrive('#float-container', (async function() {
await Matematica();
console.log('arrive is working correctly')
}))();
alert('Because the arrive library is not a function the script will generate the error "arrive is not a function", and this alert will not run')
alert('neither anything below the arrive function')
//HOW CAN I MAKE THE ARRIVE LIBRARY STOP GIVING THIS ERROR?
})();
Your code tries to invoke the result of document.arrive. This is wrong.
Remove the last ()
in this block:
document.arrive('#float-container', (async function() {
await Matematica();
console.log('arrive is working correctly')
}))();
Thanks, this worked
How can I fix this?
document.arrive('#float-container', (async function() {
await Matematica();
document.querySelector("div.ui-pdp-container__row.ui-pdp-container__row--shipping-summary").insertAdjacentHTML('afterend', htmlcodes);
}))();