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

alpine-morph swapError re().body is null #2340

Open
danbluhmhansen opened this issue Feb 20, 2024 · 2 comments
Open

alpine-morph swapError re().body is null #2340

danbluhmhansen opened this issue Feb 20, 2024 · 2 comments

Comments

@danbluhmhansen
Copy link

I get an error using hx-boost="true", hx-ext="alpine-morph", and hx-swap="morph".

image

I'm using htmx version 1.9.10, alpinejs version 3.13.5.

The requests do return a 200 OK result with valid HTML.

I did find #786 which seems related, but my error always happens no matter what speed I click around with.

@PyrekP
Copy link

PyrekP commented Feb 22, 2024

I also encountered it. Errors disappeared in my case, when I replaced:

<body hx-ext="morph">
  <!-- content -->
</body>

with

<body>
  <div id="page" hx-ext="morph">
    <!-- content -->
  </div>
</body>

I did not yet dig, exactly why... but maybe just adding id fixes it...

@danbluhmhansen
Copy link
Author

I got mine working again by changing hx-swap="morph" to hx-swap="morph:innerHTML". Setting ids didn't change anything for me.

Perhaps the alpine-morph extension documentation should mention setting the above value when using it for boosting?

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

No branches or pull requests

2 participants