CORS issue with Chat Trigger and langchain AI agent

Describe the problem/error/question

I am using this workflow from @yulia. I can get it running on n8n, but if I try the embed option, I get CORS issues and other errors.

What is the error message (if any)?

See screenshots below - various CORS-related issues. When I switched to an embed with allow origin * I got different errors about JSON.

Please share your workflow

Share the output returned by the last node





Screenshot 2024-06-21 at 2.52.20 PM

Information on your n8n setup

  • **n8n version:**0.9.1
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n cloud, embed
  • Operating system: MacOS

Hi @mikemoz, thanks for reaching out! I just pulled down the same workflow to test. It looks like you were testing using your n8n cloud account so I did as well, version 1.42.1 and following the documentation for the embedded chat option. I’m assuming you used a simple html page in your browser to test based on the n8n.html filepath in your editor.

The error that you shared in the n8n AI error popup indicates that the format of the AI node output could not be processed and is unrelated to the CORS configuration.

I was not able to replicate your console output. The first error that you received seems to indicate that you did not specify a valid value for the Allowed Origins option.

When I set a restrictive value for the Allowed Origins option I could see a corresponding error in my dev tools’ network panel indicating that there was an error in the workflow. The more generous catchall resulted in no error in my network panel.

Could you share any error messages that you see in your network panel when testing?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.