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

Enabling rewrites causes escape-string-regexp to be bundled which is not IE11 compatible #32429

Closed
stefanaxelsson opened this issue Dec 12, 2021 · 4 comments · Fixed by #32708
Labels
bug Issue was opened via the bug report template.

Comments

@stefanaxelsson
Copy link

What version of Next.js are you using?

12.0.7

What version of Node.js are you using?

14.17

What browser are you using?

IE11

What operating system are you using?

Windows

How are you deploying your application?

Vercel

Describe the Bug

Adding rewrites to a next.js project results in escape-string-regexp being bundled in the client. escape-string-regexp contains arrow functions which is not supported in IE11:

Expected Behavior

Bundled code to be functional in IE11.

To Reproduce

Enable rewrites:

next.config.js

module.exports = {
  reactStrictMode: true,
  experimental: {
    styledComponents: true,
  },
  rewrites: async () => {
    return [
      {
        source: "/rewrite",
        destination: "/",
      },
    ];
  },
};

See main.js in deployed example at:
https://styled-components-swc.vercel.app

Or full source code at:
https://github.com/stefanaxelsson/styled-components-swc

@stefanaxelsson stefanaxelsson added the bug Issue was opened via the bug report template. label Dec 12, 2021
@ijjk
Copy link
Member

ijjk commented Dec 13, 2021

Hi, this should be resolved by #32310 which is available in v12.0.8-canary.4 of Next.js, please update and give it a try!

@ijjk ijjk closed this as completed Dec 13, 2021
@pewallin
Copy link

Seems like this still doesn't work in IE11 (tested with v12.0.8-canary.11)

@stefanaxelsson
Copy link
Author

There's still an arrow function left in escape-string-regexp

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants