EvanZhouDev / bard-ai

A lightweight library to access Google Bard.
https://www.npmjs.com/package/bard-ai
GNU General Public License v3.0
117 stars 31 forks source link

[Bug]: cors issue #44

Closed rafalinliyosar closed 1 year ago

rafalinliyosar commented 1 year ago

Prerequisites

Bug description

facing cors issue, while i run basic code

Reproduction steps

  1. cess to fetch at 'https://bard.google.com/' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Other information

No response

Reproduces how often

I can reproduce this bug 100% of the time

EvanZhouDev commented 1 year ago

This is most likely because of the fact that you need a special fetch function in your environment. Easy fetch polyfilling will be available in bard-ai v2, but you can just find a browser fetch polyfill for whatever framework (or not) you're using, and assign if to "fetch." Stay tuned to #30!

EvanZhouDev commented 1 year ago

Closing for now, feel free to reopen if you need.

ramyA2Z commented 1 year ago

I am still facing this issue an am unable to proceed on anything !

EvanZhouDev commented 1 year ago

Hello! bard-ai v2 is now available. Try now...

EvanZhouDev commented 1 year ago

Otherwise, try using the new palm-api module.