lukeraymonddowning / honey

A spam prevention package for Laravel, providing honeypot techniques, ip blocking and beautifully simple Recaptcha integration. Stop spam. Use Honey.
MIT License
398 stars 23 forks source link

[Vue warn]: Template compilation error: Tags with side effect (<script> and <style>) are ignored in client component templates. #32

Closed netdjw closed 1 year ago

netdjw commented 3 years ago

Hi there!

I just started using this package, and run into this warning in Google Chorme console:

[Vue warn]: Template compilation error: Tags with side effect (<script> and <style>) are ignored in client component templates.
5  |          <input type="hidden" name="widget_form_id" value="1">
6  |  
7  |          <script>
8  |                  window.addEventListener('load', () => {
9  |                      setTimeout(() => {
10 |                          document.querySelectorAll('input[data-purpose="honey_javascript"]')
11 |                              .forEach(input => {
12 |                                  if (input.value.length > 0) {
13 |                                      return;
14 |                                  }
15 |                                  
16 |                                  input.value = "here is my key string";
17 |                                  input.dispatchEvent(new Event('change'));
18 |                              });
19 |                      }, 3000)
20 |                  });
21 |              </script>
  at <App>

My .blade.php file looks like this:

    <form action="/" method="post">
        @csrf
        <x-honey />
        <x-honey-recaptcha />
        ....
    </form>

This blade file is returned as view, and this view is inserted into the body element of HTML DOM.

Any idea?

swilla commented 2 years ago

@netdjw I created a PR that fixes this.