A few days ago, I wanted to try out the /marry cheat, when I typed in /marry Elliot the game crashed. I found it odd, so tried it with another single resident. Same thing. And then I found that if I got engaged using /engaged and went to sleep the progress wouldn’t save. This also ended up happening with the marriage cheat. However the dating cheat was working which was a silver lining. I was able to fix this glitch by having an actual wedding. But I find it strange that this would happen. The same thing I described above with /engaged happened with /pregnant. Now, for clarification I am not using SMAPI, I’m using the vanilla built in dev commands, the one enabled by going to the notepad version in your save and changing allowchatcheatsfalse to true. Hopefully this can be fixed. I can attach my save if needed. PS: I made another file and tried the cheat and it crashed so it’s not an issue with my save it’s universal.
Thanks for the report! I'll be marking this as solved as this isn't really a bug, as I'll describe below.
The
/marry
cheat is a debug command. It is only accessible by using the Stardew Modding API or by editing your save file -- prefixing with
debug
in the SMAPI console or editing your save file is an acknowledgement that these are not meant to be used in normal gameplay. If you are not careful, they can (and most likely will) crash your game at best, and/or completely break your save at worst.
From the additional info in your report on Discord, the issue is that using
/marry
or
/engaged
or
/pregnant
will inherently not work with a default farmhouse. Just like in the normal progression of the game, you cannot get engaged without having at least 1 farmhouse upgrade. As such, using a developer command to force engagement (or anything that happens after that, like marriage or pregnancy) will cause a crash, and that is expected. It is useful, as developers, to be able to force a specific game state regardless of validity, so commands lack safeguards against things like this.
Anything involving developer commands is considered low-priority and/or wont-fix issues, since they are deliberately designed to be inaccessible to the vast majority of players. Feel free to report issues with them here, but for future reference, please attach your error log, as instructed in the pinned post for bug reports:
https://forums.stardewvalley.net/threads/please-read-this-before-reporting-1-6.31177/