PricingBlog

405 Error - Web component embed in Webflow

  • chrislaupama-1252031487776264233

    Chris Laupama

    1 year ago

    When I embed my web component into Webflow I get a 405 error when trying to make an API call from a form.

    The web component contains a form which on submit makes a POST request to Buildship.
    1252031488182980778-Boostle_2024-06-17_at_10.42.53_AM.jpg
    1
  • chrislaupama-1252036170364489810

    Chris Laupama

    1 year ago

    My thoughts are the default behaviour of how Webflow handles form events is still being executed and that the "prevent default" isn't working as intended?
  • lucasg-1252040050200547328

    Lucas G

    1 year ago

    Isn't 'prevent default' for forms mostly to prevent page refresh? How would that interfere with a 405
  • Do you see anything in Buildship logs that could help?
  • chrislaupama-1252045909865402448

    Chris Laupama

    1 year ago

    Webflow has its own built in way of handing native forms - I think there's some form of clash here with my toddle built form and Webflow forms... I think...

    Check this: https://discourse.webflow.com/t/how-to-totally-disable-a-webflow-default-form-action/244744/2

    The request doesn't even hit the buildship endpoint becuase it's being blocked right off the bat. Hence another indicator that it's Webflow related.
  • erikbeus-1252149667513372722

    Erik Beuschau

    1 year ago

    Hi @Chris Laupama
    It looks like you're trying to proxy your API request. Proxying only works for apps running on toddle and not for exported web components.
    Could you try disabling the proxying of your request and see if that resolves the issue?
    1
  • chrislaupama-1252176789103579227

    Chris Laupama

    1 year ago

    @Erik Beuschau that worked! also, good to know that making that change and publishing the project also instantly updates the web component - would there be any changes when this may not work and I would need to re-export again?
  • chrislaupama-1252177510309953659

    Chris Laupama

    1 year ago

    It may also be a good thing to note when exporting that any proxied API calls can cause issues.
  • erikbeus-1252179581985751151

    Erik Beuschau

    1 year ago

    Currently, changes could be cached for up to 5 minutes. You should not need to re-export at any point.
    Yes, we should definitely mention that proxied APIs will not work for exported web components 👍
    🙌🏽1