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

partytown integration doesn't work with vercel adapter in production #12832

Open
1 task done
Kang-Jh opened this issue Dec 26, 2024 · 2 comments
Open
1 task done

partytown integration doesn't work with vercel adapter in production #12832

Kang-Jh opened this issue Dec 26, 2024 · 2 comments
Labels
needs triage Issue needs to be triaged

Comments

@Kang-Jh
Copy link

Kang-Jh commented Dec 26, 2024

Astro Info

Astro                    v5.0.5
Node                     v20.11.1
System                   Windows (x64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/vercel
Integrations             @astrojs/tailwind
                         @astrojs/solid-js
                         @astrojs/partytown
                         @sentry/astro

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

In development enviroment, partytown script loaded fine. But in production partytown script isn't loaded beacause of HTTP 404 error
partytown

I tested node and vercel adapters. Node adapter produced ~partytown directory, but vercel didn't. It might seem that vercel adapter with partytown doesn't work now.

What's the expected result?

vercel adapter produce partytown script and partytown should be loaded in a browser

Link to Minimal Reproducible Example

https://github.com/Kang-Jh/astro-partytown-repro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Dec 26, 2024
@Kang-Jh Kang-Jh changed the title @astrojs/partytown produce nothing in production partytown doesn't work with vercel adapter in production Dec 26, 2024
@Kang-Jh Kang-Jh changed the title partytown doesn't work with vercel adapter in production partytown integration doesn't work with vercel adapter in production Dec 27, 2024
@Kang-Jh
Copy link
Author

Kang-Jh commented Dec 27, 2024

It looks like when astro build process is started, adapter is called prior to integrations so vercel adapter doesn't copy partytown script because partytown paste script to the output directory(/dist) after vercel copies from it. To fix this issue, adapter needs to be executed after all integrations are executed but I don't know how it effects applications that use astro because some apps might rely on execution order of integrations.

// before
settings.config.integrations.unshift(settings.config.adapter);
// after
settings.config.integrations.push(settings.config.adapter);

@mohdlatif
Copy link

I am experiencing a similar issue where I am using an Astro compressor plugin. The compressed HTML files in the output folder differ from those in the .vercel/output/static folder when running astro build.

venables added a commit to venables/venabl.es that referenced this issue Dec 31, 2024
It doesn't work with the vercel adapter:

withastro/astro#12832
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants