Ver 1.11, Global Main.FTYPE does not exist

Hi All,
on: Julia 1.11

code:
include(“…/src/mfbd.jl”)
using Main.MFBD

where:
MFBD is the module name for mfbd.jl

yields:
ErrorException; ‘Global Main.FTYPE does not exist and cannot be assigned. Declare it using global before attempting assignment.’

Ques: is there some breaking change in 1/11; ie, this worked with 1.10?

So, what to do to make mfbd.jl, (ie, module MFBD) visible.

Thanks,
thtidrick

Provide the full error, with the stack trace and everything. Put it within a Markdown code block here. Hopefully it has more info. Though if you want very specific help probably you’ll have to provide example code, hopefully minimized.

Hi nsajko,
Here is the code that is broken.

include("../src/mfbd.jl")
using Main.MFBD

These are the first two lines in the open file when I initiated debug.

Here is the full error msg and stack trace:

Exception has occurred: ErrorException
Global Main.FTYPE does not exist and cannot be assigned. Declare it using `global` before attempting assignment.

Stacktrace:
 [1] top-level scope
   @ ~/MFBD_Projects/Proj01/mfbd.jl/demos/create_data_JASS24.jl:2

As you can see, line 2 is the issue.

Note:
This very code works with Julia ver 1.10.2
Here, I am using Julia ver 1.11.3.

This project has several modules, and ‘mfbd.jl’ is important to managing the set.
Here is a sample of the content of ‘mfbd.jl’. Note, there are several ‘include / export’ statements in this file.

module MFBD

## masks
include("masks.jl")
export Masks, make_ish_masks, make_simple_mask

My goal is to make the file mfbd.jl visible.
What I think I need is: what alternative is there with ver 1.11.3 instead of: ‘using Main.MFBD’
so that the exported methods are visible to any module?

Thanks,
thtidrick

Found some information:

Judging by the discussion there, what you’re probably doing, and is broken by Julia v1.11, is that you’re creating a global variable like so: ModuleName.variable_name = value. The stack trace should tell you where exactly that happens.

The solution is probably to create the variable variable_name in module ModuleName from the module itself, using variable_name = value.

Does that help?

Hi nsajko,
Thanks for your work. You have given me an answer and a lot to consider. At this point, I don’t yet know what to do to solve my problem. It is also the case I have other deadlines. I will come back to this problem and keep you informed.
Thanks again,
thtidrick