-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
sst-env.d.ts
Generation Missing Export in Monorepo Workspace
#4523
Comments
Please let me know if you wish me to create a minimal repository to reproduce this issue |
We made some changes to this recently, can you update your CLI? Also have a look at how our monorepo example has it: https://github.com/sst/ion/blob/dev/examples/aws-monorepo/packages/functions/sst-env.d.ts & https://github.com/sst/ion/blob/dev/examples/aws-monorepo/sst-env.d.ts Lmk if that helps. |
Hey @jayair, upgrading didn't help unfortunately and I'm following the examples correct. I believe it's this commit and specifically this line that has caused this to happen. I believe the fix would be to add I would test this locally and raise a PR however, I can't work out how to run the CLI locally so if I could get some guidance on how to run it locally or someone else could fix it that would be great |
I get the same error but when following https://ion.sst.dev/docs/start/aws/hono/. I am on a fresh github codespace with 8gb ram. |
I was able to bypass these issues by installing a 2 month old version of ion and the sst npm package. I did these steps:
|
Ok I stopped
|
Ok somehow moving this part to inside the run() function solved my issue:
|
@isaac-scarrott sorry having a bit of trouble following can you show me a full example of what is being generated? |
@thdxr Yes of course, I can also try to reproduce in a separate public repo if that will help? Outputs are as follows:
/* tslint:disable */
/* eslint-disable */
import "sst"
declare module "sst" {
export interface Resource {
AblyApiKey: {
type: "sst.sst.Secret"
value: string
}
ClerkJwtVerificationKey: {
type: "sst.sst.Secret"
value: string
}
ClerkPublishableKey: {
type: "sst.sst.Secret"
value: string
}
ClerkSecretKey: {
type: "sst.sst.Secret"
value: string
}
ContentProcessorQueue: {
type: "sst.aws.Queue"
url: string
}
HuggingFaceAccessToken: {
type: "sst.sst.Secret"
value: string
}
Main: {
type: "sst.cloudflare.Worker"
url: string
}
OpenAiApiKey: {
type: "sst.sst.Secret"
value: string
}
OpenAiOrgId: {
type: "sst.sst.Secret"
value: string
}
}
}
export {}
/* tslint:disable */
/* eslint-disable */
/// <reference path="../../sst-env.d.ts" />
// cloudflare
declare module "sst" {
export interface Resource {
ContentAssetBucket: import("@cloudflare/workers-types").R2Bucket
Database: import("@cloudflare/workers-types").D1Database
}
} If I append |
gotcha - should be fixed in v0.0.540 |
Thanks @thdxr ! |
Hey,
I'm seeing an issue with
sst-env.d.ts
in my monorepo. I have twosst-env.d.ts
files being generated, one in the root and one in my cloudflare worker folder/workspace.The root
sst-env.d.ts
seems to be correct and look something like the following:However, the
sst-env.d.ts
generated in my app/workspace folder seems to be causing an issue as it does not have export {} at the end and is causing the error'Resource' only refers to a type, but is being used as a value here when attempting to reference the resource
Also note that this is a project deployed to cloudflare.
The text was updated successfully, but these errors were encountered: