"Error thrown in the snapshot context" when calling "forge deploy"

I have got an error when I tried to deploy my app. The “hello world” app works fine. But when I added my app logic, it cannot be deployed. The error is like this:

pengxiao@pengs-air mdx-confluence % forge deploy
Deploying your app to the development environment.
Press Ctrl+C to cancel.

Running forge lint...
No issues found.

✕ Deploying mdx-confluence to development...

ℹ Packaging app files
ℹ Uploading app
ℹ Validating manifest
ℹ Snapshotting functions

Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: Code generation from strings disallowed for this context
Learn more about the snapshot context at http://go.atlassian.com/forge-snapshot-context.

Rerunning the command with --verbose may give more details.

If I understand it correctly, this is related to “eval()”, which might be the case given the function that I am trying. Is the a configuration that can ignore this warning? I have already tried “permissions:content:unsafe-eval”.

After enabled “–verbose”, it printed this following error:

        "description": "Snapshotting functions",
        "events": [
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2021-04-08T12:28:41.417Z",
            "newStatus": "STARTED"
          },
          {
            "__typename": "AppDeploymentLogEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2021-04-08T12:28:55.008Z",
            "message": "Snapshot error occurred: Error: Code generation from strings disallowed for this context\nValidation errors: {\n  \"stack\": [\n    \"Error: Snapshot error occurred: Error: Code generation from strings disallowed for this context\",\n    \"    at /var/task/index.js:36047:27\"\n  ]\n}",
            "level": "WARNING"
          },
          {
            "__typename": "AppDeploymentTransitionEvent",
            "stepName": "Generate snapshot step",
            "createdAt": "2021-04-08T12:28:55.010Z",
            "newStatus": "FAILED"
          }
        ]