The module declaration at the top of the file is needed and must match the import. So in somepackage/somemodule.d, add at the top module somepackage.somemodule; and then it will all work. While the module declaration is technically optional, any file that is imported really should have it every time.