Hello,

In my project, I load a scene randomly from a folder, like this:

var files: Array = DirAccess.get_files_at(folder_path)
var random_file = files.pick_random()
load(random_file).instantiate()

As I understood when a project is exported, the resource files are named with ".remap" suffix.
So on export I can't find my scene... My current solution is to trim the suffix of the scene path file:
load(random_file.trim_suffix(".remap")).instantiate()

What is the proper solution to load a file using DirAccess primary?

Related issue:
https://github.com/godotengine/godot/issues/66014
https://github.com/godotengine/godot/issues/25672

The first related issue you linked seems to have been closed for the 4.1 milestone. Meaning it seems this will be better supported in the next minor(not to be confused with the x.x.n bugfix/patch) release. You might want to wait for Godot 4.1 for this.