Skip to content

When building the server with NestJS, TypeScript compilation fails with the following message #1372

@ZZY080

Description

@ZZY080

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/ali-oss/lib/common/utils/policy2Str.ts b/node_modules/ali-oss/lib/common/utils/policy2Str.ts
index d088a3c..ca5eede 100644
--- a/node_modules/ali-oss/lib/common/utils/policy2Str.ts
+++ b/node_modules/ali-oss/lib/common/utils/policy2Str.ts
@@ -4,7 +4,7 @@ export function policy2Str(policy: string | object) {
     if (typeof policy === 'string') {
       try {
         policyStr = JSON.stringify(JSON.parse(policy));
-      } catch (err) {
+      } catch (err:any) {
         throw new Error(`Policy string is not a valid JSON: ${err.message}`);
       }
     } else {

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions