Skip to content

Import doesn't resolve a file module argument relative to the modules folder #130

@rgchris

Description

@rgchris

When importing a module using a file argument (or a block of files), IMPORT/LOAD-MODULE does not resolve modules relative to the modules folder.

>> import %test-mod.reb

** access error: cannot open: %test-mod.reb reason: "not found or not valid"

Where $HOME/.rebol/modules/test-mod.reb contains:

Rebol [
    Title: "Test Module"
    Date: 25-Aug-2025
    Version: 1.0.0
    File: %test-mod.reb

    Type: module
    Name: rgchris.test
    Exports: [
        test-print
    ]
]

test-print: func [] [
    print "Test from Module"
]

I recognise this might not be a bug—rather leaving open the possibility of importing files relative to the current folder. In which case it precludes the possibility of loading modules in a subfolder of the modules folder when used as a word, e.g. import rgchris/test-mod vs. import %rgchris/test-mod.reb. My sense is that if a file is not found relative to the current folder, it should be checked against the modules folder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions