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.

node does not exit if realm-js is imported

See original GitHub issue

Goals

Use realm in a cli program.

Expected Results

The program does its job and exits.

Actual Results

Node does not exit.

Steps to Reproduce

  1. Import realm-js

Code Sample

require('realm');
console.log('hello');

It prints hello and hangs.

Version of Realm and Tooling

  • Realm JS SDK Version: the issue first appeared in 1.12.0
  • Node or React Native: Node 6.11.3
  • Client OS & Version: macOS 10.12.6 and Debian 8

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
dehlencommented, Apr 10, 2018

Any news on this one ? I can reproduce the described behavior with realm-js 2.3.1 and my jest tests won’t terminate without adding the --forceExit hack.

2reactions
stigicommented, Jan 11, 2018

This also prevents jest from exiting after finishing all tests. Now this is a major annoyance as it prevents us from running tests agains in memory realms (or importing realm at all in our tests).

I created a demo project to demonstrate the issue: https://github.com/stigi/realm-require-issue

Edit: The workaround for jest is, running jest with the --forceExit flag. This triggers process.exit when all tests have been run.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Realm-js: Cannot access realm that has been closed
Realm keeps throwing this error in a simple use case: Cannot access realm that has been closed. My files: RealmExample.js import Realm from ......
Read more >
realm - npm
Realm is a mobile database that runs directly inside phones, tablets or wearables. This project hosts the JavaScript versions of Realm.
Read more >
Troubleshooting - React Native
If running on device from Xcode, you can do this by updating occurrences of 8081 to your chosen port in the ios/__App_Name__.xcodeproj/project.
Read more >
Example of Realm Database in React Native
Note: Realm library does not support node version 10 yet so if you want to use this ... Install react-navigation dependency to import...
Read more >
Getting Started - ESBuild
The recommended way to install esbuild is to install the native executable using npm. But if you don't want to do that, 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