John F
John F

Reputation: 921

VS Code Flow Stuck Initializing

I am adding flow a new project in Visual Studio code. I added the official flow plugin to VS Code and followed the configuration steps listed on the plugin readme.

VS Code seems to be stuck in a state of "Flow server is initializing..." without ever resolving, despite there being a single js file annotated with flow and a single type definition in the whole project.

I tried rebooting my OS (M1 silicon Mac mini) and tried running flow from terminal before opening VS Code:

yarn run v1.22.10
$ ~/Code/hello-world/node_modules/.bin/flow
Launching Flow server for ~/Code/hello-world
Spawned flow server (pid=1178)
Logs will go to /private/tmp/flow/zSUserszSfoushzSDevzShello-world.log
Monitor logs will go to /private/tmp/flow/zSUserszSfoushzSDevzShello-world.monitor_log
Please wait. Server is starting up:

When tailing the log file I see the server starts and immediately dies:

[2021-03-25 15:46:08.899] lazy_mode=off
[2021-03-25 15:46:08.899] abstract_locations=on
[2021-03-25 15:46:08.899] max_workers=8
[2021-03-25 15:46:08.899] debug=false
[2021-03-25 15:46:08.900] Failed to use anonymous memfd init
Out of shared memory:
Raised by primitive operation at file "src/heap/sharedMem.ml", line 60, characters 25-49
Called from file "src/hack_forked/utils/sys/daemon.ml", line 272, characters 4-26
Called from file "src/flow.ml", line 107, characters 4-31

I searched around for a bit and didn't find any indications of why this is happening, anyone know how to allow flow to use memfd?

Upvotes: 0

Views: 1234

Answers (1)

John F
John F

Reputation: 921

Found the solution here: Does Flow work well on Apple Silicon M1 Macs?

In my .flowconfig file I needed to add the option:

[options]
sharedmemory.heap_size=3221225472

After adding that option, I ran yarn run flow stop to kill the process, then ran yarn run flow and the server initialized and ran as expected.

Upvotes: 4

Related Questions