Astro Pages do not migrate to Workers Assets

It's weird. There's some build configuration issue. You can replicate it easily. Create a new project on Pages using Astro. set it up so that it builds on push to Github. Then, use that repository as a Workers Assets project. There is no way you can configure it, that I have found in code or admin, that will build.
22 Replies
RobbBoss
RobbBossOPโ€ข4w ago
I just wanted to highlight this as a thread, since it was aptly noted by @James that he believed it was straightforward to migrate, it is currently not possible. This thread is to track discussion going forward and to hopefully find some migration strategy for Astro on Pages to Astro on Workers Assets. The steps I outlined above are replication steps from scratch. I'm here to answer any questions if I was vague or unclear in replication steps. Should I file a bug report somewhere? I am willing to do so. Thank you for your attention and help!
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
RobbBoss
RobbBossOPโ€ข4w ago
Thank you thank you! I will check this out ๐Ÿ™
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
okay im a little confused too now
16:42:28.772 This could expose your private server-side code to the public Internet. Is this intended?
16:42:28.773 If you do not want to upload this directory, either remove it or add an ".assetsignore" file, to the root of your asset directory, containing "_worker.js" to avoid uploading.
16:42:28.773 If you do want to upload this directory, you can add an empty ".assetsignore" file, to the root of your asset directory, to hide this error.
16:42:28.772 This could expose your private server-side code to the public Internet. Is this intended?
16:42:28.773 If you do not want to upload this directory, either remove it or add an ".assetsignore" file, to the root of your asset directory, containing "_worker.js" to avoid uploading.
16:42:28.773 If you do want to upload this directory, you can add an empty ".assetsignore" file, to the root of your asset directory, to hide this error.
both _worker.js are IDENTICAL this makes no sense
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
i really wonder how the ci/cd would know its pages now. the repos are identical oh thats it
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
i just didnt check the public folder
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
@RobbBoss https://github.com/Sillyvan/astro-pages-to-assets/commits/main/ the 2 commits are all you need remove pages from the scripts remove pages_build_output_dir from wrangler add a main and an assets to wrangler add the .assetsingore in ./public
GitHub
Commits ยท Sillyvan/astro-pages-to-assets
Contribute to Sillyvan/astro-pages-to-assets development by creating an account on GitHub.
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
you can. i added pnpm build in the dashboard either way i guess
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
RobbBoss
RobbBossOPโ€ข4w ago
Brilliant! Thank you!!! I had to run to a meeting but I'm back in this now, and wow thank you, this looks like it will probably work for me, too. I'll check it out now and report back. Thank you thank you!!
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
i didnt have one. it was literally just the missing .assetsignore
Unknown User
Unknown Userโ€ข4w ago
Message Not Public
Sign In & Join Server To View
Silvan
Silvanโ€ข4w ago
but i got that error without pages entries. take the astro assets example and delete the .assetsignore. it will show that error its just an outdated error or something
RobbBoss
RobbBossOPโ€ข4w ago
This seems to be what I was missing, as well. Also the bindings needed to be updated, I had missed that originally, too. ...I'm dealing with a conflicted merge right now, though, ...which is super fun times. I'll be able to update shortly ๐Ÿคž๐Ÿฝ๐Ÿคž๐Ÿฝ Alright! I think that was the thing. It looks like we're building now. ๐Ÿ˜„ ๐Ÿ˜„ You two are brilliant! Thank you so much for your concerted efforts @Silvan @FlikTeoh !!! ๐Ÿ™๐Ÿฝ This should be the official instruction, or at least a guidepost for creating tooling. I'll have a go at that this afternoon. Brilliant work, I had been having so many issues. thank you
Silvan
Silvanโ€ข4w ago
you are welcome. cf docs are too massiv i mostly learned by trying and praying but slowly things make sense
RobbBoss
RobbBossOPโ€ข4w ago
I think I needed to have that wrangler.jsonc file in the root of the project, too, and I had not added that in yet, since my build process was creating that for me for Pages, apparently. So that was necessary, too, I think, but without the .assetsignore in the /public dir I was shooting in the dark. I never would have looked in there. ... I should have probably done a diff on the directories, but I wasn't building them locally, I was using IDX in a remote instance. maybe a reason to go back to vim? alas. brilliant effort and it was, I think, much needed for the good of all. I think you both probably helped way more than me today. ๐Ÿ™๐Ÿฝ๐Ÿ˜‰

Did you find this page helpful?