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

Doesn't work on web #48

Open
MiguelNiblock opened this issue Jan 7, 2022 · 0 comments
Open

Doesn't work on web #48

MiguelNiblock opened this issue Jan 7, 2022 · 0 comments

Comments

@MiguelNiblock
Copy link

MiguelNiblock commented Jan 7, 2022

This issue #37 has some suggestions for fixing it on web, but they haven't been implemented, or confirmed to work.

Currently when I use it on web, I get this:

(Meanwhile it works perfectly fine in mobile)

Unhandled Rejection (TypeError): Failed to fetch
Function.<anonymous>
/home/user/Documents/Files/Computer_Science/Projects/farmGen_GrownBy/lib/services/Google.service.ts:126
  123 |   query.strictBounds ? '&strictbounds' : ''
  124 | }`;
  125 | 
> 126 | const res = await fetch(url);
      | ^  127 | 
  128 | if (!res.ok) {
  129 |   throw new Error(res.statusText);
View compiled
▶ 5 stack frames were collapsed.
GoogleAutoComplete.<anonymous>
/home/user/Documents/Files/Computer_Science/Projects/farmGen_GrownBy/lib/GoogleAutocomplete.tsx:160
  157 | };
  158 | 
  159 | try {
> 160 |   const results = await GoogleService._search(term, searchOpts);
      | ^  161 | 
  162 |   this.setState({
  163 |     locationResults: results.predictions,
View compiled
▶ 4 stack frames were collapsed.
GoogleAutoComplete.<anonymous>
/home/user/Documents/Files/Computer_Science/Projects/farmGen_GrownBy/lib/GoogleAutocomplete.tsx:144
  141 | /**
  142 |  * Search to google automplete service
  143 |  */
> 144 | private _search = debounce(async (term: string) => {
      | ^  145 |   if (this._isMounted) {
  146 |     this.setState({ isSearching: true });
  147 | 
View compiled
▶ 3 stack frames were collapsed.
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.  Click the 'X' or hit ESC to dismiss this message.
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

1 participant