# Unable to instantiate UnrealEd module for non-editor targets

**URL:** <https://forums.unrealengine.com/t/unable-to-instantiate-unrealed-module-for-non-editor-targets/489377>\
**Category:** Platform & Builds\
**Tags:** package, error, critical-error, unreal-engine, package-error, question\
**Created:** [September 30, 2021, 12:07pm UTC](https://forums.unrealengine.com/t/unable-to-instantiate-unrealed-module-for-non-editor-targets/489377 "2021-09-30T12:07:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nande](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nande/32/1057698_2.png) [@nande](https://forums.unrealengine.com/u/nande)\
**Post date:** [September 29, 2022, 10:12pm UTC](https://forums.unrealengine.com/t/unable-to-instantiate-unrealed-module-for-non-editor-targets/489377/2 "2022-09-29T22:12:44Z")

</div>

There could be several causes to this.  
I think you would need to create a module/plugin for your code that depends on editor. and set it to be editor mode.  
on the uproject you might want to also set the target allow list to editor for your module.  
on your module you need to set the module “Type” to “Editor”.  
and the important part is in your build.cs for your module, to add the dependencies only if it’s an editor build.

> [@How to detect if it's editor build in Build.cs?](https://forums.unrealengine.com/t/how-to-detect-if-its-editor-build-in-build-cs/427255/2):
>
> Try this: if (Target.bBuildEditor) { PrivateDependencyModuleNames.Add("UnrealEd"); }

And then when calling/including your code you might need to use #if blocks  
heres a guide. a bit outdated but good anyway.

> **[Creating an Editor Module | Unreal Engine Community Wiki](https://unrealcommunity.wiki/creating-an-editor-module-x64nt5g3)**
>
> What is an editor module? An editor module allows you to extend the functionality of the editor for your own custom C++ Actors, Components and other classes. You can do a variety of things such as ...

> [@Unable to instantiate UnrealEd module for non-editor targets](https://forums.unrealengine.com/t/unable-to-instantiate-unrealed-module-for-non-editor-targets/150048):
>
> I see this when packaging the project for windows 64 bit. \*\*Error: \*\*Unable to instantiate UnrealEd module for non-editor targets I understand this means I must be using something that should be editor use only, but I’m not sure where it’s coming from. I only have two Function Libraries which could be causing this. So I’ll list the headers in those that I’m using: I have a file that I’m using to clear cookies. #include "Runtime\WebBrowser\Public\IWebBrowserSingleton.h" #include "Runtime\W…

---

_[View the full topic](https://forums.unrealengine.com/t/unable-to-instantiate-unrealed-module-for-non-editor-targets/489377)._
