withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
45.42k stars 2.37k forks source link

Cannot deploy GitHub Pages project with astro db configured #11514

Open thatONEjustin opened 1 month ago

thatONEjustin commented 1 month ago

Astro Info

Astro                    v4.12.0
Node                     v21.6.2
System                   macOS (arm64)
Package Manager          bun
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/mdx
                         @astrojs/alpinejs

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

No response

Describe the Bug

Steps to reproduce

Push to repo, build starts. the build step fails with exit code 1.

build error:

Run withastro/action@v2
Run len=`echo $INPUT_PM | wc -c`
Run actions/setup-node@v4
Found in cache @ /opt/hostedtoolcache/node/20.15.1/x64
Environment details
/opt/hostedtoolcache/node/20.15.1/x64/bin/npm config get cache
/home/runner/.npm
Received 0 of 52150001 (0.0%), 0.0 MBs/sec
Cache Size: ~50 MB (52150001 B)
/usr/bin/tar -xf /home/runner/work/_temp/14f035ca-f869-4fff-b896-1f8c0896b085/cache.tzst -P -C /home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io --use-compress-program unzstd
Cache restored successfully
Cache restored from key: node-cache-Linux-npm-05f[7](https://github.com/thatONEjustin/thatONEjustin.github.io/actions/runs/10021561493/job/27700375425#step:3:8)ac1f9a10cde3bb9a23fe78763eef3498ec8b232b7323b96814f9e160669e
Received 52150001 of 52150001 (100.0%), 24.9 MBs/sec
Run $PACKAGE_MANAGER install
npm warn deprecated momentjs@2.0.0: WARNING: The correct package name for Moment.js is 'moment', not 'momentjs'.

added 707 packages, and audited 708 packages in 5s

233 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues, run:
  npm audit fix

Run `npm audit` for details.
Run $PACKAGE_MANAGER run build

> personal-website@1.0.0 build
> astro build --remote

16:23:09 Types generated 273ms
16:23:09 [astro:db] database: remote
16:23:09 [build] output: "static"
16:23:09 [build] directory: /home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io/dist/
16:23:09 [build] Collecting build info...
16:23:09 [build] ✓ Completed in 351ms.
16:23:09 [build] Building static entrypoints...
Cannot read properties of undefined (reading 'send')
  Stack trace:
    at getTempViteServer (file:///home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io/node_modules/@astrojs/db/dist/core/integration/index.js:1[88](https://github.com/thatONEjustin/thatONEjustin.github.io/actions/runs/10021561493/job/27700375425#step:3:93):38)
    at async withTakingALongTimeMsg (file:///home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io/node_modules/astro/dist/integrations/index.js:23:18)
    at async ssrBuild (file:///home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io/node_modules/astro/dist/core/build/static-build.js:210:34)
    at async AstroBuilder.build (file:///home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io/node_modules/astro/dist/core/build/index.js:137:48)
    at async build (file:///home/runner/work/thatONEjustin.github.io/thatONEjustin.github.io/node_modules/astro/dist/core/build/index.js:47:3)
Error: Process completed with exit code 1

I can also confirm that the build works locally with --remote flag and other installation steps completed. I was also able to run the execute command and seed the DB so I know my secret key setup and CLI logins are working.

What's the expected result?

For the site to build and deploy.

I cannot link to a reproducible build on stackblitz because stackblitz doesn't allow astro config files (to my understanding)

Link to Minimal Reproducible Example

https://github.com/thatONEjustin/thatONEjustin.github.io/actions/runs/10021561493/job/27700375425#step:3:120

Participation

matthewp commented 1 month ago

It is hard to tell from that error message what the problem is. It might not be related to Astro DB at all. Stackblitz does allow Astro config files, you can use https://astro.new/latest/ to create an example. If you'd prefer to create one and push to GitHub too that would work. Just so I can fork something and test it out. Something minimal. Thanks.

github-actions[bot] commented 1 month ago

Hello @thatONEjustin. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

thatONEjustin commented 1 month ago

I'm still a little confused on setting up a stackblitz for this, this happens ONLY in a Github Action. everything works fine on my local machine. anyway I'm just trying to keep this open for now so here's a setup stack blitz with the configuration stuff set up as I had it.

https://stackblitz.com/edit/github-zs2kbp?file=.github%2Fworkflows%2Fdeploy.yml

Its hard to troubleshoot because my build errors only happen during the Astro provided build step in an action when the astro:db libraries are imported. I can run build locally and everything works good. It is only during a github pages deployment that I run into this error.

matthewp commented 1 month ago

That's ok, just having the reproduction is what matters, using stackblitz was not required, just something we can fork and play around with. Thanks for it!