-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Transforming async generator functions is not supported yet #5870
Comments
Hello, can anyone please help me with this? 😅 |
@axelthat I managed to make this work by using
The legacy files are created with the polyfills, But I couldn't find any reference to them in the HTML files created. As of right now I don't have the required env to test if it actually works in older browsers I cannot confirm it is actually working or not. |
I don't think this plugin is going to do what you're hoping for—it's currently compiling the Astro server-side JS to a legacy format. It's also not going to automatically reference the down-leveled JS since we handle script injection ourselves. As of right now, all I can say is that this isn't currently supported but we may be able to fix that in the future. |
Thank you for your reply. I just have one question. Won’t this stop people from adopting Astro? Most people use astro for their static site and these sites demands to be run in legacy browsers. Nevertheless I hope this issue is fixed soon. Thanks! |
Same issue here. I am running an ecommerce store on Astro 2.0 and need support for older browsers. Would be awesome to be able to use |
The code shown here is Astro's internal code; it does not run in the browser. I think the problem is you are using a Vite plugin that is running both to transform the server code and the client code. If you want to run a Vite plugin just on the client code you'll need to use the integration API to do that, which would work something like this: import pluginLegacy from '@vitejs/plugin-legacy';
import { defineConfig } from 'astro/config';
export default defineConfig({
integrations: [
{
name: 'my-integration',
hooks: {
'astro:build:setup': ({ vite, target }) => {
if(target === 'client') {
vite.plugins.push(pluginLegacy());
}
}
}
}
]
}); |
Works! You guys are just doing amazing work. Thanks so much for your help. |
Unfortunately, you can only create legacy chunks, but not to inject them into generated html files using this approach. Is it possible to automaticaly inject legacy chunks with |
What version of
astro
are you using?1.9.1
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
I want to support old browsers for my website. I am currently trying to use
@vitejs/plugin-legacy
. But while building I get this error,How do I fix this?
Link to Minimal Reproducible Example
https://stackblitz.com/edit/typescript-ry3189
Participation
The text was updated successfully, but these errors were encountered: