# ERROR: LoadError: type DataType has no field size

**URL:** https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-size/102209
**Category:** New to Julia
**Tags:** question
**Created:** [July 28, 2023, 7:28pm UTC](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-size/102209 "2023-07-28T19:28:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ameersain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ameersain/32/51897_2.png) [@ameersain](https://discourse.julialang.org/u/ameersain)
#### Post date: [July 28, 2023, 7:28pm UTC](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-size/102209/1 "2023-07-28T19:28:22Z")

</div>

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

```julia
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.

---

<div class="post-metadata">

### Author: ![algunion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/algunion/32/51630_2.png) [@algunion](https://discourse.julialang.org/u/algunion)
#### Post date: [July 28, 2023, 10:28pm UTC](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-size/102209/2 "2023-07-28T22:28:33Z")

</div>

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:

```julia
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.

---

<div class="post-metadata">

### Author: ![ameersain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ameersain/32/51897_2.png) [@ameersain](https://discourse.julialang.org/u/ameersain)
#### Post date: [July 29, 2023, 2:28am UTC](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-size/102209/3 "2023-07-29T02:28:25Z")

</div>

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

```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.

---

<div class="post-metadata">

### Author: ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)
#### Post date: [July 29, 2023, 3:24am UTC](https://discourse.julialang.org/t/error-loaderror-type-datatype-has-no-field-size/102209/4 "2023-07-29T03:24:34Z")

</div>

[Issue #438](https://github.com/JuliaIO/JLD2.jl/pull/438/files) 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()`?
