ERROR: LoadError: type DataType has no field size

Hi. I am new to Julia and i am working on a project using Agents.jl.
I installed the Agents package and it was working fine for a while but now when I try and do

using Agents

I get an error saying type DataType has no field size. I have tried to uninstall and install the Agents and JLD2 package as well as update them but nothings working. It also says “Failed to precompile Agents”. Not sure on how to proceed, any help would be appreciated.

Hello @ameersain, and welcome.

The error you report is unlikely to be related to the Agents package; however, adding more context might help figure out what is happening.

Can you indicate some more details about your environment - Julia version & the project/package you have in progress?

Posting the full error report might help.

For example, I forced the error you received in my REPL, and it looks like this:

ERROR: type DataType has no field size
Stacktrace:
 [1] getproperty(x::Type, f::Symbol)
   @ Base ./Base.jl:32
 [2] top-level scope
   @ ~/code/playtest/wrong/jlwrong.jl:3

That stacktrace might help us determine the origin of the error you receive.

1 Like

Thank you for your response @algunion. This is the full error report.
I am using v1.9.2 of Julia.

[ Info: Precompiling Agents [46ada45e-f475-11e8-01d0-f70cc89e6671]
WARNING: method definition for #GridSpace#48 at C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\spaces\grid.jl:46 declares type variable W but does not use it.
ERROR: LoadError: type DataType has no field size
Stacktrace:
 [1] getproperty(x::Type, f::Symbol)
   @ Base .\Base.jl:32
 [2] top-level scope
   @ C:\Users\ameer\.julia\packages\JLD2\qncOK\src\data\number_types.jl:14
 [3] include(mod::Module, _path::String)
   @ Base .\Base.jl:457
 [4] include(x::String)
   @ JLD2 C:\Users\ameer\.julia\packages\JLD2\qncOK\src\JLD2.jl:1
 [5] top-level scope
   @ C:\Users\ameer\.julia\packages\JLD2\qncOK\src\JLD2.jl:453
 [6] include
   @ .\Base.jl:457 [inlined]
 [7] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::String)
   @ Base .\loading.jl:2049
 [8] top-level scope
   @ stdin:3
in expression starting at C:\Users\ameer\.julia\packages\JLD2\qncOK\src\data\number_types.jl:13
in expression starting at C:\Users\ameer\.julia\packages\JLD2\qncOK\src\JLD2.jl:1
in expression starting at stdin:3
ERROR: LoadError: Failed to precompile JLD2 [033835bb-8acc-5ee8-8aae-3f567f8a3819] to "C:\\Users\\ameer\\.julia\\compiled\\v1.9\\JLD2\\jl_92DB.tmp".
Stacktrace:
  [1] error(s::String)
    @ Base .\error.jl:35
  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
    @ Base .\loading.jl:2300
  [3] compilecache
    @ .\loading.jl:2167 [inlined]
  [4] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:1805
  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:1660
  [6] macro expansion
    @ .\loading.jl:1648 [inlined]
  [7] macro expansion
    @ .\lock.jl:267 [inlined]
  [8] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:1611
  [9] include(mod::Module, _path::String)
    @ Base .\Base.jl:457
 [10] include(x::String)
    @ Agents.AgentsIO C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\submodules\io\AgentsIO.jl:9
 [11] top-level scope
    @ C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\submodules\io\AgentsIO.jl:13
 [12] include(mod::Module, _path::String)
    @ Base .\Base.jl:457
 [13] include(x::String)
    @ Agents C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\Agents.jl:1
 [14] top-level scope
    @ C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\Agents.jl:38
 [15] include
    @ .\Base.jl:457 [inlined]
 [16] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base .\loading.jl:2049
 [17] top-level scope
    @ stdin:3
in expression starting at C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\submodules\io\jld2_integration.jl:2
in expression starting at C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\submodules\io\AgentsIO.jl:3
in expression starting at C:\Users\ameer\.julia\packages\Agents\h9Ls1\src\Agents.jl:1
in expression starting at stdin:3

Failed to precompile Agents [46ada45e-f475-11e8-01d0-f70cc89e6671] to “C:\Users\ameer\.julia\compiled\v1.9\Agents\jl_6E2C.tmp”.

Stacktrace:
[1] error(s::String)
@ Base .\error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base .\loading.jl:2300
[3] compilecache
@ .\loading.jl:2167 [inlined]
[4] _require(pkg::Base.PkgId, env::String)
@ Base .\loading.jl:1805
[5] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base .\loading.jl:1660
[6] macro expansion
@ .\loading.jl:1648 [inlined]
[7] macro expansion
@ .\lock.jl:267 [inlined]
[8] require(into::Module, mod::Symbol)
@ Base .\loading.jl:1611

I am very new to Julia, so I have little knowledge about whats going on, but I can share whatever extra information that is needed.

Issue #438 seems to show a relevant v0.4.28 patch, but you said you had already updated JLD2.jl…What’s it say in your using Pkg; Pkg.status()?

1 Like