Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i always get this error fetch is not defined when submit the domain #36

Open
KressIsMee opened this issue Mar 11, 2024 · 15 comments
Open

Comments

@KressIsMee
Copy link

npm run index domain.com

google-indexing-script@0.0.2 index
ts-node ./src/cli.ts domain.com

🔎 Processing site: sc-domain:domain.com
/seo/google-indexing-script/src/shared/utils.ts:19
const response = await fetch(url, options);
^
ReferenceError: fetch is not defined
at fetchRetry (/seo/google-indexing-script/src/shared/utils.ts:19:22)
at fetchRetry (seo/google-indexing-script/src/shared/utils.ts:29:12)
at fetchRetry (/seo/google-indexing-script/src/shared/utils.ts:29:12)
at fetchRetry (/seo/google-indexing-script/src/shared/utils.ts:29:12)
at fetchRetry (/seo/google-indexing-script/src/shared/utils.ts:29:12)
at fetchRetry (/seo/google-indexing-script/src/shared/utils.ts:29:12)
at getSitemapsList (/seo/google-indexing-script/src/shared/sitemap.ts:8:36)
at getSitemapPages (/seo/google-indexing-script/src/shared/sitemap.ts:38:26)
at index (/seo/google-indexing-script/src/index.ts:50:50)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

@goenning
Copy link
Owner

Your node is probably outdated, try updating that first.

@AntoineKM maybe we could check for presence of “fetch” and then exit early

@AntoineKM
Copy link
Contributor

AntoineKM commented Mar 11, 2024

Hey, it's because you are using a version of Node prior to 18.

See: https://stackoverflow.com/a/48433898/12379218

@AntoineKM
Copy link
Contributor

Your node is probably outdated, try updating that first.

@AntoineKM maybe we could check for presence of “fetch” and then exit early

We could implement node-fetch

@KressIsMee
Copy link
Author

KressIsMee commented Mar 11, 2024

thanks by upgrading node problem solved but i got another error


(node:172055) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
🔎 Processing site: sc-domain:mywebsite.com
🔐 This service account doesn't have access to this site.
❌ No sitemaps found, add them to Google Search Console and try again.
and im sure the service account json file in the right place

@AntoineKM
Copy link
Contributor

Nice ! Did you miss this step ?

image

@KressIsMee
Copy link
Author

KressIsMee commented Mar 12, 2024

Untitleffdfd

Untitled
nop i didn't

@AntoineKM
Copy link
Contributor

Are you sure you're on the right property?
npm run index domain.com or npm run index https://domain.com are different properties, you might try both of them

@KressIsMee
Copy link
Author

Are you sure you're on the right property? npm run index domain.com or npm run index https://domain.com are different properties, you might try both of them

i tryed all how can i prove that onn the right probarty i tryed all not working

@KressIsMee
Copy link
Author

KressIsMee commented Mar 13, 2024

I'm so frustrated i have only one website and only now google console account

@AntoineKM
Copy link
Contributor

We'll get there, don't worry, I also remember having trouble setting up the project, this will help me remember what it was and put together clearer information in the README.

Did you activate these apis:

@KressIsMee
Copy link
Author

KressIsMee commented Mar 14, 2024

thanks a lot it works perfect i think i just i forget and enabled it on other project , can i access it through web, that can have multiple services account , cause i exceeded the limits of one services account and when i changed it repeats the same urls till it exceeded the limits on the same urls and control it locally, thanks a lot
node --trace-deprecation ... to show where the warning was created)
🔎 Processing site: https://www.domain.com/
👉 Found 4735 URLs in 1 sitemap
📦 Batch 1 of 95 complete
📦 Batch 2 of 95 complete
📦 Batch 3 of 95 complete
📦 Batch 4 of 95 complete
📄 Processing url: https://www.dmain/prepare for power cuts and travel disruptions as storm isha hits the uk
🕛 Indexing already requested previously. It may take a few days for Google to process it.

📄 Processing url: https://www.dmain/arsenal edges past spirited everton in close encounter
🕛 Indexing already requested previously. It may take a few days for Google to process it.

📄 Processing url: https://www.dmain/murderonthedancefloor: the latest viral trend on tiktok
🕛 Indexing already requested previously. It may take a few days for Google to process it.

📄 Processing url: https://www.dmain/night swim: a lukewarm attempt at horror by blumhouse productions
🕛 Indexing already requested previously. It may take a few days for Google to process it.

📄 Processing url: https://www.dmain/breakingnews: silt police investigate incident involving u.s. rep. lauren boebert and ex-husband
🕛 Indexing already requested previously. It may take a few days for Google to process it.

📄 Processing url: https://www.dmain/green bay packers secure nfc wild card playoff spot with victory over chicago bears
🕛 Indexing already requested previously. It may take a few days for Google to process it.

@AntoineKM
Copy link
Contributor

I've seen guys use this technique on another software, I don't know if it's authorized by Google, but if it works, you can try opening a pull request with the possibility of having several service accounts.

@KressIsMee
Copy link
Author

is there any genuine web control panel for this script ? that would be awesome to change these setting even manually but through web

@AntoineKM
Copy link
Contributor

Not at the moment, but it was one of my ideas 😁

@KressIsMee
Copy link
Author

KressIsMee commented Mar 15, 2024

Not at the moment, but it was one of my ideas 😁

Its great and I like it I just facing this problem
Indexing already requested previously and I can't index the new articles cause its always catch the old links according to sitemap.xml arrangement so I never got the chance to index the new lines 😒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants