Skip to content
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

🐛 Bug: Webhook Error: You must pass a string or Handlebars AST to Handlebars.compile. You passed [object Object] #3932

Closed
1 task done
3699n opened this issue Oct 4, 2022 · 4 comments
Assignees

Comments

@3699n
Copy link

3699n commented Oct 4, 2022

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

  1. Create a new webook.
  2. Add webhook url and request type
  3. Paste the sample payload below the field below into the body text box.
{
  "data": {
    "Startup Name": "Text",
    "Status": "First Call",
    "Priority": "Low",
    "Lead Found": "2022-10-04T15:07:12.154Z",
    "Industry": "Edtech",
    "Questions and Comments": "Long text",
    "Pitch Deck URL": "https://nocodb.com",
    "Pitch Deck PDF": "[{\"url\":\"https://nocodb.com/dummy.png\",\"title\":\"image.png\",\"mimetype\":\"image/png\",\"size\":0}]",
    "Summary": "Text",
    "Contact Email": "test@nocodb.com",
    "Website": "https://nocodb.com",
    "First Name": "Text",
    "Source": "Network",
    "Country": "UK",
    "Desired Ticket": "$123",
    "Desired Pre-Money Valuation": "$123",
    "Last Name": "Text",
    "DD": "Long text",
    "DD Documents": "[{\"url\":\"https://nocodb.com/dummy.png\",\"title\":\"image.png\",\"mimetype\":\"image/png\",\"size\":0}]",
    "First Email Sent": true,
    "ncRecordId": 1,
    "ncRecordHash": "Text"
  }
}
  1. Press test webhook
  2. Error toast: Error: You must pass a string or Handlebars AST to Handlebars.compile. You passed [object Object]

Logs:

Oct 04 15:11:40 v :: Error: You must pass a string or Handlebars AST to Handlebars.compile. You passed [object Object]
Oct 04 15:11:40 at Object.compile (/app/code/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js:494:11)
Oct 04 15:11:40 at HandlebarsEnvironment.hb.compile (/app/code/node_modules/handlebars/dist/cjs/handlebars.js:39:40)
Oct 04 15:11:40 at l (/app/code/node_modules/nocodb/dist/bundle.js:2:535456)
Oct 04 15:11:40 at u (/app/code/node_modules/nocodb/dist/bundle.js:2:536811)
Oct 04 15:11:40 at d (/app/code/node_modules/nocodb/dist/bundle.js:2:536648)
Oct 04 15:11:40 at t.invokeWebhook (/app/code/node_modules/nocodb/dist/bundle.js:2:538082)
Oct 04 15:11:40 at v (/app/code/node_modules/nocodb/dist/bundle.js:2:1401576)
Oct 04 15:11:40 at runMicrotasks (<anonymous>)
Oct 04 15:11:40 at processTicksAndRejections (node:internal/process/task_queues:96:5)
Oct 04 15:11:40 at async /app/code/node_modules/nocodb/dist/bundle.js:2:37950 {
Oct 04 15:11:40 description: undefined,
Oct 04 15:11:40 fileName: undefined,
Oct 04 15:11:40 lineNumber: undefined,
Oct 04 15:11:40 endLineNumber: undefined,
Oct 04 15:11:40 number: undefined
Oct 04 15:11:40 }
Oct 04 15:11:40 POST /api/v1/db/meta/tables/md_cdrvfg5a6f0bpp/hooks/test 400 100 - 4.317 ms

Desired Behavior

Webhook test should succeed or at least reply with a HTTP error.

Project Details

NocoDB 0.97.0 running in Docker on Cloudron with Postgres

Attachements

No response

@3699n
Copy link
Author

3699n commented Oct 9, 2022

I just want to add that I receive the same error when I try to use any form of handlebars syntax in the body, except when I just leave the default pre-filled {{json data}}. Does #3954 resolve this issue in general?

@wingkwong
Copy link
Member

@3699n Can you try it with this docker tag nocodb/nocodb-daily:0.97.0-20221009-0013 ?

@3699n
Copy link
Author

3699n commented Oct 13, 2022

@wingkwong Unfortunately I cannot test it on my Cloudron instance. Doesn't support custom images.

@github-actions
Copy link
Contributor

Fixed in v0.98.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants