This demonstrates a problem with sst/ion where Nextjs projects in a sub-directory from root are not able to access SST generated types (such a references to the secrets, nextjs url, DynamoDB table names, etc).
See the sst/ion issue 530
See the commit messages (multiline) which outline the steps taken to create.
Notes:
/sst-env.d.ts
has generated references to the secret and nextjs resources/packages/dashboard/sst-env.d.ts
has a relative reference to the rootsst-env.d.ts
- Look in
/packages/dashboard/src/app/page.tsx
where there is a Resource import and attempt to use the secret value - I tried this with the placeholder value and after setting a value for the secret
- My IDE (Jetbrains PHPStorm) says it can't find module 'sst' (this does work in my original project)
- Unable to reference
Resource.MySecret
due to missing 'sst', but in my original projectResource
is found but there are no known properties.