To reproduce, create this source tree: libsrc\ package.d main.d The contents of libsrc\package.d: module lib; The contents of main.d: module main; import lib; void main() {} Map 'lib' package to 'libsrc' folder and compile: dmd -i -mv=lib=libsrc main.d main.d(3): Error: module `lib` is in file 'lib.d' which cannot be read
Fixed by: https://github.com/dlang/dmd/pull/14501