#Crashing (even after a reinstall)

1 messages · Page 1 of 1 (latest)

lost shard
#

Game crashes with the following error:

Oops! Something went wrong:
main.lua:100: module 'luasteam' not found: no field package.preload['luasteam']
no 'luasteam' in LOVE game directories. no file 'luasteam' in LOVE paths.
no file 'luasteam.lua'
no file 'C:\Program Files (x86)\Steam\steamapps\common\Balatro\lua\luasteam.lua'
no file 'C:\Program Files (x86)\Steam\steamapps\common\Balatro\lua\luasteam\init.lua'
no file 'C:\Users\***\scoop\apps\lua\current\bin'
Crash Reports are set to Off. If you would like to send crash reports, please opt in in the Game settings. These crash reports help us avoid issues like this in the future

luasteam.dll is present

honest flicker
#

I just ran into this too

From what I can tell, the problem is that Balatro is sensitive to the LUA_CPATH environment variable. When you work with Lua, the value of this variable tells Lua where to look for compiled C modules that can be require-ed in Lua.

One way to do this without affecting your Lua installation is to 1) open a terminal, 2) unset the variable, and 3) run Balatro.exe. For example, with powershell, this would be

Remove-Item Env:LUA_CPATH
cd "C:\Program Files (x86)\Steam\steamapps\common\Balatro"
.\Balatro.exe

But note that you **can't **use the steam launcher nor the start menu and desktop shortcuts. You have to use the terminal each time. This stinks.

You could also:

  • prepend the Balatro game directory path to the LUA_CPATH variable. This variable uses a special syntax where you need to wildcard the DLLs in the format ?.dll and also semicolon-delimit the values.
[System.Environment]::SetEnvironmentVariable('LUA_CPATH', "C:\Program Files (x86)\Steam\steamapps\common\Balatro\?.dll;" + [System.Environment]::GetEnvironmentVariable('LUA_CPATH', 'User'), 'User')
_Make sure to completely restart Steam afterwards (system tray -> right click Steam icon -> "Exit Steam")_
But this stinks too because there's no good reason you'd want to search in this path for other general Lua development.
  • Just delete the LUA_CPATH variable, but now your Lua is broken.

  • Uninstall the lua scoop package, but now you can't use Lua at all.

All of these are unreasonable options. A user may have this variable set for other work on their PC, and Balatro shouldn't take cues on where to find its own stuff from an out-of-band variable value.