# Unable to package my game : error 'Unable to instantiate module 'UnrealEd': Unable to instantiate UnrealEd module for non-editor targets'

**URL:** <https://forums.unrealengine.com/t/unable-to-package-my-game-error-unable-to-instantiate-module-unrealed-unable-to-instantiate-unrealed-module-for-non-editor-targets/1620894>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [January 17, 2024, 6:20am UTC](https://forums.unrealengine.com/t/unable-to-package-my-game-error-unable-to-instantiate-module-unrealed-unable-to-instantiate-unrealed-module-for-non-editor-targets/1620894 "2024-01-17T06:20:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![artanist](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@artanist](https://forums.unrealengine.com/u/artanist)\
**Post date:** [January 17, 2024, 6:20am UTC](https://forums.unrealengine.com/t/unable-to-package-my-game-error-unable-to-instantiate-module-unrealed-unable-to-instantiate-unrealed-module-for-non-editor-targets/1620894/1 "2024-01-17T06:20:16Z")

</div>

I am trying to build my game and I have the following error:  
Unable to instantiate module ‘UnrealEd’: Unable to instantiate UnrealEd module for non-editor targets.

I have parse through the forum and people have found the solution of removing ‘UnrealEd’ from the uproject file, but for me it is not there. It is in the build.cs, but if I remove it, I can no longer compile the editor.

Is it possible to package the game from outside the editor ? Or is it possible to spot easely which one of my script use that module and use #if WITH\_EDITOR?

---

<div class="post-metadata">

**Author:** ![artanist](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@artanist](https://forums.unrealengine.com/u/artanist)\
**Post date:** [January 17, 2024, 6:56am UTC](https://forums.unrealengine.com/t/unable-to-package-my-game-error-unable-to-instantiate-module-unrealed-unable-to-instantiate-unrealed-module-for-non-editor-targets/1620894/2 "2024-01-17T06:56:27Z")

</div>

Solve the issue. If you need the module active for some reason, here how you can isolate the module that should only be use in the editor.

> ```
> PublicDependencyModuleNames.AddRange(new string[] { "GameplayAbilities", "GameplayTags", "GameplayTasks", "Core", "CoreUObject", "Engine", "InputCore", "UMG"});
> if (Target.bBuildEditor)
> {
> PrivateDependencyModuleNames.AddRange(new string[] { "LevelEditor", "UnrealEd" });
> }
> else
> {
> PrivateDependencyModuleNames.AddRange(new string[] { });
> }
> 
> ```

Still got other issues, but at least I got rid of that blocker

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 16, 2024, 6:56am UTC](https://forums.unrealengine.com/t/unable-to-package-my-game-error-unable-to-instantiate-module-unrealed-unable-to-instantiate-unrealed-module-for-non-editor-targets/1620894/3 "2024-02-16T06:56:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
