Maintenance: Declare @standard-schema/spec as a dependency
Closed this issue ยท 7 comments
Summary
The import from @standard-schema/spec added here was not declared as a dependency in the batch package.
PR with the new type import #4408.
Why is this needed?
I'm running into build errors without this dependency.
Which area does this relate to?
Batch Processing
Solution
Adding @standard-schema/spec as a dependency in the batch package.
Acknowledgment
- This request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with ๐ and your use case to help us understand customer demand.
Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #typescript channel on our Powertools for AWS Lambda Discord: Invite link
Hi @RoMujambit, can you provide more details about the build error that you're encountering. The @standard-schema/spec should be optional as per https://github.com/standard-schema/standard-schema?tab=readme-ov-file#do-i-need-to-add-standard-schemaspec-as-a-dependency. Also, it's only a type import, which should get stripped during the build
Hi @sdangol,
i'm sorry i wasn't specific enough.
I meant that tsc fails with the following error:
Error: node_modules/@aws-lambda-powertools/batch/lib/cjs/types.d.ts(2,39): error TS2307: Cannot find module '@standard-schema/spec' or its corresponding type declarations.
In the link you provided it mentions "You can just copy and paste the types into your project", but the import does not target some copied types. It imports from the installed package, which is not included as a dependency in batch.
Am I overlooking something on my part?
Hey @RoMujambit, yeah you're right. Sorry, it was a mistake on my part. Thanks for raising the issue, I was able to replicate the issue and we're working on a fix for this.
Warning
This issue is now closed. Please be mindful that future comments are hard for our team to see.
If you need more assistance, please either reopen the issue, or open a new issue referencing this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Hi @RoMujambit, we've now merged the PR to add it as a dependency. This will be available in our next release. You should be able to mitigate the issue for now by installing @standard-schema/spec before the release.
This is now released under v2.27.0 version!