# Project cannot compile during packaging - No such file or directory - but can run game and build from VS2022

**URL:** <https://forums.unrealengine.com/t/project-cannot-compile-during-packaging-no-such-file-or-directory-but-can-run-game-and-build-from-vs2022/1136290>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [April 21, 2023, 10:49pm UTC](https://forums.unrealengine.com/t/project-cannot-compile-during-packaging-no-such-file-or-directory-but-can-run-game-and-build-from-vs2022/1136290 "2023-04-21T22:49:09Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![3dRaven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/3draven/32/906552_2.png) [@3dRaven](https://forums.unrealengine.com/u/3dRaven)\
**Post date:** [April 22, 2023, 9:21am UTC](https://forums.unrealengine.com/t/project-cannot-compile-during-packaging-no-such-file-or-directory-but-can-run-game-and-build-from-vs2022/1136290/2 "2023-04-22T09:21:34Z")

</div>

MaterialFactoryNew requires the module [UnrealEd](https://docs.unrealengine.com/5.1/en-US/API/Editor/UnrealEd/) which is an editor only module.

This thread might be of help regarding getting UnrealEd in a packaged project up and running

> [@UnrealEd Dependency Causes Package Failure](https://forums.unrealengine.com/t/unrealed-dependency-causes-package-failure/19940/3):
>
> Michael, thank you very much for the quick response! I’ve setup a new module that encapsulates my editor code and I am able to get it to compile. However when I package I still run into the same issue, I thought the ‘Type’:‘Editor’ would take care of the ‘don’t include it when cooking’ part of your suggestion but I’m guessing that is not enough. Might anyone know how can I make it so that my new editor module is not included when I package the game?

Also try replacing the angled brackets with double quotation marks as in the unreal documentation

#include “Factories/MaterialFactoryNew.h”

---

_[View the full topic](https://forums.unrealengine.com/t/project-cannot-compile-during-packaging-no-such-file-or-directory-but-can-run-game-and-build-from-vs2022/1136290)._
