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

Astro integration broken #313

Closed
riderx opened this issue Jan 15, 2025 · 11 comments
Closed

Astro integration broken #313

riderx opened this issue Jan 15, 2025 · 11 comments
Labels

Comments

@riderx
Copy link

riderx commented Jan 15, 2025

I have a website where the translation were done manually, I found out this plugin and tried it here: https://github.com/Cap-go/website/tree/migrate_i18n
since then, Astro page doesn't load. It times out locally, without error.
I took hours to debug and if I basically removed all pages/component and let only index.
I still have the issue.
If I remove all translation and let only few, it works back.
If I remove the translation from the page it loads, if I just add the import without even using it again, infinite load.
I did use npx paraglide-js compile --project ./project.inlang --outdir ./src/paraglide to lint in case something was off in my file and i got no error.
I'm reaching the limit of what i can do.
I also tried to use the same config in TS and astro as here: https://github.com/opral/monorepo/blob/39c013d01e6134fc5ad07818949e260fc815abba/inlang/source-code/paraglide/paraglide-astro/example/astro.config.mjs
no better.

@riderx
Copy link
Author

riderx commented Jan 15, 2025

I made a branch where i isolated the problem better: https://github.com/Cap-go/website/tree/debug_paraglide

@riderx
Copy link
Author

riderx commented Jan 15, 2025

I added comment in the index file to help testing it: https://github.com/Cap-go/website/blob/debug_paraglide/src/vue-pages/index.vue

@riderx
Copy link
Author

riderx commented Jan 15, 2025

@samuelstroschein does issue is the correct way to report?
I see you use discussion and linear so i'm not sure I'm doing it correctly

Copy link
Member

Yep, correct way of reporting the issue! I see all comments in linear. Will look into the reproduction after #312 which i expect to finish today

@riderx
Copy link
Author

riderx commented Jan 16, 2025

Thanks a lot !

@samuelstroschein
Copy link
Member

samuelstroschein commented Jan 18, 2025

Identified problem

Astro has a bug/is too slow for large JS files in dev mode.

Next steps

Test if dev mode can be sped up by leveraging virtual modules #273 or emitting TS instead of JS

Reproduction

Running astro dev with a large number of messages (>1000 * 8 locales = >8000 messages).

messages.zip

Observations:

  • npm run build and npm run preview works as expected
  • you forgot to call the message functions samuelstroschein/website-1@f71ab85
  • removing the paraglide astro integration has no effect

@riderx
Copy link
Author

riderx commented Jan 18, 2025

Thanks for looking at it, does experimentalUseVirtualModules will be available in the astro integration v 0.4.1 ?

@samuelstroschein
Copy link
Member

Focus atm is #201. Ideally, I'd like to keep virtual modules out of it. I am going to try to create a reproduction of Astro's slow dev mode and file an issue for Astro. Will report later today.

@samuelstroschein
Copy link
Member

Filed the bug withastro/astro#13004. This is an Astro issue given that the Vite project works fine

@riderx
Copy link
Author

riderx commented Jan 18, 2025

Thanks a lot !

@samuelstroschein
Copy link
Member

It's an astro bug that is caused by having a message named then, see withastro/astro#13004 (comment) please remove or rename the message then in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants