Open bep opened 2 years ago
cc @seanpdoyle
@bep thank you for opening this issue. Are you able to reproduce this behavior with https://github.com/hotwired/turbo/releases/tag/v7.2.0-rc.2?
@seanpdoyle I have tested my app with both v7.2.0-rc.2 and v7.2.0-rc.1. I'm using Turbo with an AlpineJS app, an what I see on 404 errors are some uncaught JS errors indicating a somewhat corrupt state:
I think this issue is about 2 things:
This GItHub issue is mostly about 1, and I would be a happy camper if isSuccessful
would consider 404 to be a success (or if this could somehow be configured).
This has been a topic before, e.g. with @denydias 's comment in https://github.com/hotwired/turbo/issues/188#issuecomment-1101973056
That issue is closed, but I have tested this with the Turbo main branch as of yesterday (I notice there have since been some commits).
I see there have been some work on this with the
turbo:frame-missing
for Turbo Frames, but for Turbo Drive this still leads to a faulty and unpredictable state.I have a patched version that simply add the 404 to the OK list here:
https://github.com/hotwired/turbo/blob/d81e24db77da05f53c6ab3c66e2620574c9e08c9/src/core/drive/visit.ts#L490
I would say that from a rendering perspective (which is Turbo's domain), a 404 is (almost always?) a correct thing to do.