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

[🐞] Guidance Needed: Using Partytown with Google Places API in Next.js 15 #649

Open
alisahindev opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@alisahindev
Copy link

Describe the bug

Hello,

I am working on a project using Next.js 15 and aiming to integrate the Google Places API. To improve performance, I want to use Partytown to load the Google Places script in a web worker. However, I am encountering some difficulties and would appreciate guidance or examples on how to implement this setup correctly.

  1. Next.js Version: 15
  2. App Router: Enabled with experimental features.
  3. Partytown Configuration: Installed @builder.io/partytown.
  4. Configured Partytown in the public folder as per the documentation.
  5. Google Places API: Trying to load the script via Partytown to offload its execution to a web worker.

Code Snippets in layout.tsx

<Script
 src={`https://maps.googleapis.com/maps/api/js? 
 key=${process.env.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}&libraries=places`}
 type="text/partytown" />

<Partytown debug={true} forward={["google.maps.places"]} />

Reproduction

https://codesandbox.io/p/devbox/6h99fx

Steps to reproduce

You can see how isnt worked on codesandbox

Browser Info

Chrome

Additional Information

No response

@alisahindev alisahindev added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant