Problem loading a prefab from a custom local package

I want to load a prefab that I added in a custom local package, and it fails (returns null). I am using

 
    var prefab = Resources.Load<Boat>("Packages/com.company.module/Assets/Resources/Boat.prefab");

I got the prefab path from my project by right clicking on the prefab and selecting “Copy Path”. I also checked that the path is part of UnityEditor.AssetDatabase.GetAllAssetPaths().

I used to load this exact prefab fine when it was in the project Asset/Resources folder, but now I have moved it to a custom package and it doesn’t load anymore.

What could go wrong? Is there a way to get some more detailed error log, or inspect a build structure and see what’s wrong?

Note: if I create a public variable in my scene’s script and drag and drop the prefab from the package to that variable (in the Editor UI), it instantiates just fine. I would prefer to load by code though.

public class SceneScript: MonoBehaviour
{
    public Boat boatPrefab2;

    void Start()
    {
        var boatPrefab1 = Resources.Load<Boat>("Packages/com.company.module/Assets/Resources/Boat.prefab");
        // boatPrefab1 is set to null
    
        Boat boat2 = Instantiate(boatPrefab2, boatsParent.transform);
        // instantiation works fine
    }
}

If I’m not mistaken this path should be, regardless of whether in a Package or under Assets:
var prefab = Resources.Load<Boat>("Boat");

All Resources paths are cobbled together and to load an asset you must not specify a file extension, nor the path leading up to a specific Resources folder. You have to use folders (or asset types) to uniquely identify resource assets. If you want this package to be consumed by others, you need to be extra careful in avoiding naming clashes, ie use a root folder similar to com.company.module under each Resources folder.

See examples on Resources.Load manual page.

You were right again on this one. Thank you, this is resolved.