Told System Issue For Caching Exists And To Report For Investigation

by ADMIN 69 views

Describe the Bug

We are experiencing a critical issue with the Google Maps API authorization in our application, specifically a RefererNotAllowedMapError. Despite taking all the necessary steps on the Google Cloud Console side, the issue persists. The problem lies in how the Bolt environment handles the API key or referrer information, which is outside the scope of what can be fixed through code changes.

The Error

The error is related to Google Maps API authorization, specifically a RefererNotAllowedMapError. The user has already taken all the necessary steps on the Google Cloud Console side:

  • Added the correct domain to the allowed referrers
  • Enabled the required APIs
  • Configured the API key correctly
  • Waited for propagation

However, the issue appears to be related to how the Bolt environment handles the API key or referrer information, which is outside the scope of what can be fixed through code changes.

Steps to Reproduce

To reproduce the issue, follow these steps:

  1. Ensure the .env file in the Bolt project environment contains VITE_GOOGLE_PLACES_API_KEY=AIzaSyAY2QvjjQZ84mGJFKPAve_gAul6q-ok-Oo.
  2. Navigate to any page in the LYNC Letters AI application that uses the AddressAutocomplete component (e.g., the letter creation page where sender or receiver addresses are entered).
  3. Attempt to type an address into the "Street Address" input field that is meant to trigger Google Places Autocomplete.
  4. Observe the browser's developer console for the RefererNotAllowedMapError. The autocomplete suggestions will not appear, and the component will likely fall back to manual input mode due to the error.

Expected Behavior

The Google Places Autocomplete should initialize successfully without any RefererNotAllowedMapError. As the user types into the address input field, a dropdown of address suggestions from Google Maps should appear. Selecting an address should populate the respective address fields (street, city, state, zip).

Platform

  • Browser name: Chrome
  • Full version: 136.0.0.0
  • Major version: 136
  • navigator.appName: Netscape
  • navigator.userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
  • performance.memory: "totalJSHeapSize" 153464144, "usedJSHeapSize": 145826136, "jsHeapSizeLimit": 4294705152
  • Username: tsquaredtech
  • Chat ID: 46573f52c14a
  • Client version: 8a33762
  • Server version: 8a33762

Additional Context

Issue Impact:

This error prevents a key user experience feature (address autocomplete) from working, requiring users to manually enter all address components, which is less efficient and more prone to errors.

Request for Bolt.new Support:

As per the Bolt AI agent's reasoning, this appears to be an environment-level issue related to how the Bolt preview environment's referrer information is being handled or perceived by Google Maps API, or how API keys from .env are injected/cached, despite correct configuration on the Google Cloud Console side.

Please investigate:

  • If there are any caching layers within the Bolt environment that might be serving stale API key configurations.
  • The exact Referer header being sent from the *.webcontainer-api.io domain when it makes requests to maps.googleapis.com.
  • If there are any known best practices or specific wildcard patterns required for Google API referrer restrictions when using Bolt's dynamic webcontainer environments that might differ from standard configurations.
  • Could you try a full cache clear and rebuild of the project environment?
  • Could you internally test with a known-good, broadly unrestricted Google Maps API key (if available to your team for diagnostics) from this specific webcontainer environment to see if any key works, to isolate if it's an issue with my specific key's interaction vs. the environment itself?

We need assistance from your team to resolve this environment-specific API authorization issue.

Q: What is the issue with the Google Maps API authorization?

A: The issue is a RefererNotAllowedMapError that prevents the Google Places Autocomplete from working correctly. Despite taking all the necessary steps on the Google Cloud Console side, the issue persists.

Q: What are the steps to reproduce the issue?

A: To reproduce the issue, follow these steps:

  1. Ensure the .env file in the Bolt project environment contains VITE_GOOGLE_PLACES_API_KEY=AIzaSyAY2QvjjQZ84mGJFKPAve_gAul6q-ok-Oo.
  2. Navigate to any page in the LYNC Letters AI application that uses the AddressAutocomplete component (e.g., the letter creation page where sender or receiver addresses are entered).
  3. Attempt to type an address into the "Street Address" input field that is meant to trigger Google Places Autocomplete.
  4. Observe the browser's developer console for the RefererNotAllowedMapError. The autocomplete suggestions will not appear, and the component will likely fall back to manual input mode due to the error.

Q: What is the expected behavior?

A: The Google Places Autocomplete should initialize successfully without any RefererNotAllowedMapError. As the user types into the address input field, a dropdown of address suggestions from Google Maps should appear. Selecting an address should populate the respective address fields (street, city, state, zip).

Q: What is the platform information?

A: The platform information is as follows:

  • Browser name: Chrome
  • Full version: 136.0.0.0
  • Major version: 136
  • navigator.appName: Netscape
  • navigator.userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
  • performance.memory: "totalJSHeapSize" 153464144, "usedJSHeapSize": 145826136, "jsHeapSizeLimit": 4294705152
  • Username: tsquaredtech
  • Chat ID: 46573f52c14a
  • Client version: 8a33762
  • Server version: 8a33762

Q: What is the impact of this issue?

A: This error prevents a key user experience feature (address autocomplete) from working, requiring users to manually enter all address components, which is less efficient and more prone to errors.

Q: What is the request for Bolt.new Support?

A: As per the Bolt AI agent's reasoning, this appears to be an environment-level issue related to how the Bolt preview environment's referrer information is being handled or perceived by Google Maps API, or how API keys from .env are injected/cached, despite correct configuration on the Google Cloud Console side.

Please investigate:

  • If there are any caching layers within the Bolt environment that might be serving stale API key configurations.
  • The exact Referer header being sent from the *.webcontainer-api.io domain when it makes requests to maps.googleapis.com.
  • If there are any known best practices or specific wildcard patterns required for Google referrer restrictions when using Bolt's dynamic webcontainer environments that might differ from standard configurations.
  • Could you try a full cache clear and rebuild of the project environment?
  • Could you internally test with a known-good, broadly unrestricted Google Maps API key (if available to your team for diagnostics) from this specific webcontainer environment to see if any key works, to isolate if it's an issue with my specific key's interaction vs. the environment itself?

We need assistance from your team to resolve this environment-specific API authorization issue.

Q: What is the next step?

A: The next step is to contact Bolt.new support to investigate the issue and provide a solution.