sst / ion

SST v3
https://sst.dev
MIT License
1.95k stars 230 forks source link

example documentation for astro site does not work #353

Closed lschierer closed 5 months ago

lschierer commented 5 months ago

The fairly minimal example on the ion docs for an astro site does not work. I was trying to create a minimal reproduction of another bug and hit this.

I ran

pnpm create astro --template starlight
cd large-static-bug
sst init

then corrected a few things. 1) the sst init mucked up the astro config, removing starlight. 2) the sst init mucked up the package.json, using html entities instead of literal ampersands between astro check and astro build

then

pnpm astro build

which worked and

export AWS_PROFILE='home'; sst deploy --stage dev

which resulted in

node:11185) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
|  Creating    MyWeb sst:aws:Astro → MyWebRegionalServerCode aws:s3:BucketObjectv2
|  Created     MyWeb sst:aws:Astro → MyWebRegionalServerCode aws:s3:BucketObjectv2 (1.2s)
|  Creating    MyWeb sst:aws:Astro → MyWebRegionalServerCode aws:s3:BucketObjectv2
|  Created     MyWeb sst:aws:Astro → MyWebRegionalServerCode aws:s3:BucketObjectv2
|  Updating    MyWeb sst:aws:Astro → MyWebRegionalServerCodeUpdater sst:aws:FunctionCodeUpdater
|  Updated     MyWeb sst:aws:Astro → MyWebRegionalServerCodeUpdater sst:aws:FunctionCodeUpdater (2.0s)
The Pulumi runtime detected that 284 promises were still active
at the time that the process exited. There are a few ways that this can occur:
  * Not using `await` or `.then` on a Promise returned from a Pulumi API
  * Introducing a cyclic dependency between two Pulumi Resources
  * A bug in the Pulumi Runtime
Leaving promises active is probably not what you want. If you are unsure about
why you are seeing this message, re-run your program with the `PULUMI_DEBUG_PROMISE_LEAKS`
environment variable. The Pulumi runtime will then print out additional
debug information about the leaked promises.
|  Error

×  Failed
san4d commented 5 months ago

I'm using Astro with SST now. A few others have run into the "promises active" issue. Try updating your SST version.

Regarding the package.json and config issues, I bet this happens with other projects too. Personally, I don't find the init too helpful.

It really servers to make sure:

  1. You have sst as a dependency in your package.json
  2. You're using the astro-sst adapter
  3. The .sst directory gets initialized.

I manually "merge" the generated output.

lschierer commented 5 months ago

mm. I'd checked before submitting, and there hadn't been one available but there was when I saw your comment, and upgrading from my brew provided install from sst/tap/sst 0.0.339 to 0.0.343 did fix this.