#astro-i18n-aut in SSR mode
32 messages ยท Page 1 of 1 (latest)
Also @modern gorge in Astro 2.9 (maybe before) redirects are no longer experimental - not entirely sure what impact that has on the package
@polar obsidian just bumped astro-i18n-aut and removed mentions of experimental redirects. It bumps the minimum astro version, removes warnings, and removes mentions of experimental from the docs
@polar obsidian the middleware does not depend on node. Only the build step before deploy depends on node. Which adapter are you using? Is your project on github?
I was trying to use cloudflare
And this works awesome in dev - appreciate all your work!
I may have incorrectly identified the problem too
And this works awesome in dev - appreciate all your work!
glad to hear it ๐
But every astro file returns a bunch of node errors when I try to build
I tried local build in the project npm run build and also tried it connected with cloudflare
interesting, I do see the local build errors
yeah Astro docs say that it bundles the middleware into each file for cloudflare: https://docs.astro.build/en/guides/integrations-guide/cloudflare/#options
So far that is my best guess why basically every file with internationalization seems to be popping up with the errors ๐คทโโ๏ธ
what it could be is that those node packages are being pulled in through the utils, and I could try separating that out
since everything is exported in one index file
oh it seems you did separate that
there is an incompatibility with supabase https://github.com/supabase/supabase-js#custom-fetch-implementation
Its a bit of a mash up between the Astro recipe and astro-i18n-aut - which seems to work in dev but I could be doing something wrong
Oh interesting - wonder if that is new I had another project with supabase (but less complex) that is on cloudflare and didn't do this ๐ง
I commented out every mention of astro-i18n-aut, and it seems like another library has node internals
For example, astro-icon depends on svgo which depends on node
I do think that astro-i18n-aut middleware may be part of the problem because Astro isn't tree-shaking, I'll see if separating that out fixes it
Yeah I have been trying to strip packages out to see if I can get anything to build but not very successfully. Its odd because like astro-icon is written by one of the main Astro maintainers and I can't find anything that says it wouldn't work with SSR/Cloudflare
It seems that separating out the exports (not using one index.ts barrel file) fixes the remaining build errors ๐
I'll go ahead and make two separate files to import:
- the utils and middleware
- the integration
You'll need to:
- remove
astro-icon - fix https://github.com/supabase/supabase-js#custom-fetch-implementation
- upgrade
astro-i18n-autonce a new version 0.3.0 is released
@fallow ivy Is astro-icon not SSR compatible? I found some posts from October 2022 that it wasn't SSR ready but nothing since - is this still on the roadmap?
Oh I just found this: https://github.com/natemoo-re/astro-icon/issues/35#issuecomment-1613873295 - so I think astro-icon@next might solve the astro-icon issue @modern gorge
@polar obsidian the good news is it builds with the new package structure! The bad news it the types don't work yet