question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Experimental rewrites don't work on iOS devices

See original GitHub issue

Bug report

Describe the bug

The new experimental feature of rewrites messes up on iOS devices.

Given this rewrite domain.tld/a to other.tld/path/to. If consumed with a laptop, Android, et altri it redirects correctly. If consumed with iOS (iPhone/iPad) it redirects to domain.tld/path/to (mixes the domain and pathname).

To Reproduce

  1. Rewrites are here
  2. Go to https://sospedra.me/r/rjpr with a laptop (you’re gonna end up in Spotify)
  3. Go to the same address with an iOS device (you’re gonna end up in a nextjs 404)

Expected behaviour

It should redirect properly regarding the OS.

Additional context

I assume this has something to do with Vercel’s machinery because it works great in yarn dev and yarn start. It only goes crazy when deployed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ijjkcommented, Jun 13, 2020

@sospedra you can create a redirect in a similar way to how you are adding the rewrites in your next.config.js e.g.

module.exports = {
  experimental: {
    async redirects() {
      return [
        {
          source: '/r/rjpr',
          destination: 'https://open.spotify.com/playlist/26NYRcXPyIVrItOtlJ5ahO',
          permanent: false
        }
      ]
    }
  }
}
1reaction
sospedracommented, Jun 15, 2020

Damn boy! Didn’t know about rewrites/redirects Super appreciated @ijjk that works like a charm ☺️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reset Safari's Experimental Features to the Defaults to Fix or ...
Navigate to Settings –> Safari –> Advanced –> Experimental Features, and then scroll to the bottom and tap "Reset All to Defaults." There...
Read more >
iOS 15 Experimental WebKit Features: GPU Process
Hello,. Just wondering if any folks have insight on one of the new experimental features that is enabled by default on the latest...
Read more >
iOS 16.2 Settings You Need To Turn Off Now - YouTube
David & David tell you about 25 iOS 16.2 settings you need to turn off now. There are several new iOS 16 settings...
Read more >
40+ iOS 15.4 changes and features - hands-on with what's new
The releases include many iOS 15.4 changes and features, ... WebXR experiments; Reset Safari experimental features; iOS 15.4 stops iCloud ...
Read more >
Forget iOS 16, These Are the iPhone Hidden Features You ...
Apple has made a lot of changes to Safari for the iPhone and iPad. One of the major changes you'll notice after installing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found