Skip to content

Remix dev mode redirect bug when verbatimModuleSyntax is set to true #10083

Open
@brookslybrand

Description

@brookslybrand

Reproduction

https://stackblitz.com/edit/remix-run-remix-e89vvn?file=tsconfig.json,app%2Froot.tsx,app%2Froutes%2Fsignup.tsx,app%2Froutes%2Fverify.tsx

System Info

latest remix packages and what not, your can see in the reproduction

Used Package Manager

npm

Expected Behavior

Redirect from an action should work as expected

Actual Behavior

This is one of the weirdest bugs I've run into. Basically if you have

// tsconfig.json
{
  "verbatimModuleSyntax": true,
}

and very specific imports setup, when you try to redirect from an action it'll cause the whole page to refresh and cancel the redirect. This isn't a problem in production, but it caused for a very difficult to track down bug in a larger app someone shared with me.

redirect-madness.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions