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

Array.prototype.at is not transpiled and causes TypeError in browsers #44423

Closed
1 task done
paulgreg opened this issue Dec 29, 2022 · 3 comments · Fixed by #44436
Closed
1 task done

Array.prototype.at is not transpiled and causes TypeError in browsers #44423

paulgreg opened this issue Dec 29, 2022 · 3 comments · Fixed by #44436
Labels
bug Issue was opened via the bug report template. locked SWC Related to minification/transpilation in Next.js.

Comments

@paulgreg
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #61-Ubuntu SMP Fri Oct 14 13:05:50 UTC 2022
Binaries:
  Node: 18.12.1
  npm: 8.19.2
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.1.1
  eslint-config-next: 13.1.1
  react: 18.2.0
  react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

SWC transpilation

Link to the code that reproduces this issue

https://codesandbox.io/s/awesome-dewdney-yp0x9d?file=/pages/index.tsx

To Reproduce

Create a new app via npx create-next-app@canary with default options

Add console.log([1,2,3].at(0)) in pages/index.tsx.

npm run build && npm run start

Describe the Bug

Open http://localhost:3000 in Chrome 91, Firefox 89 or Safari 13 (any browser not supporting array.at)

An error will occurs : TypeError: "[...].at is not a function"

The code isn’t transpiled to older browsers.

Expected Behavior

Code is transpiled and works on older browsers as described in next browser support documentation.

Which browser are you using? (if relevant)

Safari 13.1

How are you deploying your application? (if relevant)

No response

@paulgreg paulgreg added the bug Issue was opened via the bug report template. label Dec 29, 2022
@github-actions github-actions bot added the SWC Related to minification/transpilation in Next.js. label Dec 29, 2022
@bertho-zero
Copy link
Contributor

Same error, I have to temporarily replace my Array.at

@klaasman
Copy link
Contributor

klaasman commented Sep 5, 2023

This seems to be fixed ~2 weeks ago: #44436

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2023
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. locked SWC Related to minification/transpilation in Next.js.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants