goenning/google-indexing-script

ReferenceError: fetch is not defined

karakhanyans opened this issue · 2 comments

I was using project successfully, but recently started to see following error

❯ gis larafast.com
🔎 Processing site: sc-domain:larafast.com
/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:1
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkIL7T5FMLjs = require('./chunk-IL7T5FML.js');async function m(r,n,c,t){let e=h(n,c);for(let o=0;o<e.length;o++)await Promise.all(e[o].map(r)),t(o,e.length)}async function u(r,n,c=5){try{let t=await fetch(r,n);if(t.status>=500){let e=await t.text();throw new Error(`Server error code ${t.status}
                                                                                                                                                                                                                                                                                  ^

ReferenceError: fetch is not defined
    at u (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:1:275)
    at u (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:2:49)
    at u (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:2:49)
    at u (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:2:49)
    at u (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:2:49)
    at u (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-TTTS3QMW.js:2:49)
    at l (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-MEQJBOPJ.js:1:512)
    at h (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-MEQJBOPJ.js:1:1104)
    at exports.a (/Users/sergeykarakhanyan/Projects/google-indexing-script/dist/chunk-LBCQ44KW.js:1:2244)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Seems like you’re using an old Nodejs version?

You are right, used node v16 for another project, and this was affected too.

Changed to v22, works fine.

Sorry to bother you.