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.

With Hermes engine, certain date formats crash on production but works in debug

See original GitHub issue

React Native version: RN60

new Date(‘Jul 18, 2018’) is not supported on RN new Date(‘18-07-2018 12:00’) is not supported on RN

Steps To Reproduce

  1. add date: const reproduce = new Date(‘Jul 18, 2018’);
  2. It will crash in production

Describe what you expected to happen: It should return the expected date.

Snack, code example, screenshot, or link to a repository:

export function getDateFormat(date = ‘Jul 18, 2018’ ) { const newDate = new Date(date); return newDate; }

export function getDateFormat(date = ‘18-07-2018 12:00’ ) { const newDate = new Date(date); return newDate; }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jmeistrichcommented, Sep 8, 2019

I’m seeing this also. A date in ISO format like Fri, 06 Sep 2019 18:45:29 +0000 (UTC) parses as an Invalid Date in Hermes. It works on iOS and was working in Android in 0.59. I am now using Moment as a workaround but this should be supported natively.

0reactions
stale[bot]commented, Dec 14, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React native app with Hermes crashes with "SIGSEGV
If Hermes was broken completely, I would definitely know it. This issue happens many times every day, but the vast majority (99.x%) of...
Read more >
API - ESBuild
To join a set of files together with esbuild, import them all into a single entry point file and bundle just that one...
Read more >
Get to know different JavaScript environments in React Native
This returns the correct Date object in debug mode, but yields Invalid Date in release. What's special about Date constructor?
Read more >
Android meeting sdk crash on initialize - Zoom Developer Forum
App is suddenly crash when calling zoomSDK.initialize() method. I have added proguard rules as well but no luck. My build.gradle is below: ...
Read more >
How to improve the performance of a React Native app
React Navigation is lightweight and can work for both small- and large-scale applications. Avoid Use of ScrollView to Render Huge Lists. There ...
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