umbraco / Umbraco-CMS

Umbraco is a free and open source .NET content management system helping you deliver delightful digital experiences.
https://umbraco.com
MIT License
4.36k stars 2.64k forks source link

Umbraco backoffice node_modules content exceeds OS path limit #16659

Closed gregor-tusar-sowa closed 3 days ago

gregor-tusar-sowa commented 3 days ago

Which Umbraco version are you using? (Please write the exact version, example: 10.1.0)

14.0.0

Bug summary

While updating custom dashboard from v13 to v14 we stumbled upon an issue that is caused by Umbraco @umbraco-cms/backoffice package.

While trying to build the solution a lot of paths exceed the OS limit of 260.

Shortening some of our names did not help, because after that copying to output directory fails.

The paths of some of the node_modules files itself is 185 char long, so adding drive letter, some folders to solution and build output folder bin\Debug\net8.0\ quickly exceeds OS max limit.

Specifics

No response

Steps to reproduce

Expected result / actual result

We expect the solution would successfully build.

ACTUAL RESULT:

Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-type-configuration\property-editor-ui-block-grid-type-configuration.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-group-configuration\property-editor-ui-block-grid-group-configuration.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-group-configuration\property-editor-ui-block-grid-group-configuration.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-group-configuration\property-editor-ui-block-grid-group-configuration.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-group-configuration\property-editor-ui-block-grid-group-configuration.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-layout-stylesheet\property-editor-ui-block-grid-layout-stylesheet.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-layout-stylesheet\property-editor-ui-block-grid-layout-stylesheet.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-layout-stylesheet\property-editor-ui-block-grid-layout-stylesheet.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-grid\property-editors\block-grid-layout-stylesheet\property-editor-ui-block-grid-layout-stylesheet.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-list\property-editors\block-list-type-configuration\property-editor-ui-block-list-type-configuration.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-list\property-editors\block-list-type-configuration\property-editor-ui-block-list-type-configuration.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-list\property-editors\block-list-type-configuration\property-editor-ui-block-list-type-configuration.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-list\property-editors\block-list-type-configuration\property-editor-ui-block-list-type-configuration.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-type\property-editors\block-type-group-configuration\property-editor-ui-block-type-group-configuration.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-type\property-editors\block-type-group-configuration\property-editor-ui-block-type-group-configuration.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-type\property-editors\block-type-group-configuration\property-editor-ui-block-type-group-configuration.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\block\block-type\property-editors\block-type-group-configuration\property-editor-ui-block-type-group-configuration.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.kind.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.kind.js". Exceeded retry count of 10. Failed.   
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.kind.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\core\workspace\components\workspace-breadcrumb\workspace-variant-menu-breadcrumb\workspace-variant-menu-breadcrumb.kind.d.ts". Exceeded retry count of 10. Failed.   
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\documents\documents\user-permissions\input-document-granular-user-permission\input-document-granular-user-permission.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\documents\documents\user-permissions\input-document-granular-user-permission\input-document-granular-user-permission.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\documents\documents\user-permissions\input-document-granular-user-permission\input-document-granular-user-permission.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\documents\documents\user-permissions\input-document-granular-user-permission\input-document-granular-user-permission.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\property-editors\content-picker\dynamic-root\input-content-picker-document-root\input-content-picker-document-root.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\property-editors\content-picker\dynamic-root\input-content-picker-document-root\input-content-picker-document-root.element.d.ts". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\property-editors\content-picker\dynamic-root\input-content-picker-document-root\input-content-picker-document-root.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\property-editors\content-picker\dynamic-root\input-content-picker-document-root\input-content-picker-document-root.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\templating\modals\templating-page-field-builder\components\template-field-dropdown-list\template-field-dropdown-list.element.js" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\templating\modals\templating-page-field-builder\components\template-field-dropdown-list\template-field-dropdown-list.element.js". Exceeded retry count of 10. Failed.     
Error (active)  MSB3027 Could not copy "C:\src\ORG\MyComp\src\Cms\Company.Cms\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\templating\modals\templating-page-field-builder\components\template-field-dropdown-list\template-field-dropdown-list.element.d.ts" to "bin\Debug\net8.0\App_Plugins\welcome-dashboard\node_modules\@umbraco-cms\backoffice\dist-cms\packages\templating\modals\templating-page-field-builder\components\template-field-dropdown-list\template-field-dropdown-list.element.d.ts". Exceeded retry count of 10. Failed.
github-actions[bot] commented 3 days ago

Hi there @gregor-tusar-sowa!

Firstly, a big thank you for raising this issue. Every piece of feedback we receive helps us to make Umbraco better.

We really appreciate your patience while we wait for our team to have a look at this but we wanted to let you know that we see this and share with you the plan for what comes next.

We wish we could work with everyone directly and assess your issue immediately but we're in the fortunate position of having lots of contributions to work with and only a few humans who are able to do it. We are making progress though and in the meantime, we will keep you in the loop and let you know when we have any questions.

Thanks, from your friendly Umbraco GitHub bot :robot: :slightly_smiling_face:

iOvergaard commented 3 days ago

Hello, and thanks for reporting this.

We are planning to shorten the paths, but it is challenging to get under the abstract path length of 260 characters in Windows. Up until now, we have only seen the problem with regards to the Backoffice files in the Umbraco StaticAssets RCL. What I do not fully grasp here is why Visual Studio (I presume) is copying "node_modules" to your "bin/debug" folder. That is certainly not needed to build an extension for Umbraco.

There is a similar situation described here, where an Angular project exceeded the file length of Windows and a proposed solution to ignore the node_modules folder. I think that could work for your situation, would you be willing to try it out?

gregor-tusar-sowa commented 3 days ago

I managed to solve this issue with updating the MSBuild version to 17.10. The issue was that Visual Studio took MSBuild version 16, which failed to copy long file paths. After changing the path to the MSBuild in environmental variables to the newest MSBuild the build went through smoothly.

iOvergaard commented 3 days ago

Oh, good to know @gregor-tusar-sowa! Just be aware that you don't need to have node_modules in your output folder for this to work, so you can save a few bytes by excluding it.

gregor-tusar-sowa commented 3 days ago

Thanks for letting me know that.

Adding this ItemGroup to my project does not exclude the node_modules folder to being copied to output and I don't know why.

  <ItemGroup>
    <Content Remove="App_Plugins\**\node_modules\**" />
    <Compile Remove="App_Plugins\**\node_modules\**" />
    <EmbeddedResource Remove="App_Plugins\**\node_modules\**" />
    <None Remove="App_Plugins\**\node_modules\**" />
  </ItemGroup>
iOvergaard commented 2 days ago

@gregor-tusar-sowa I am still looking into this to see, how you could exclude node_modules and other unwanted files. It looks like the Umbraco.Cms.Targets overrule whatever you try to do since it will copy App_Plugins blindly following this:

https://github.com/umbraco/Umbraco-CMS/blob/3ce2e97f5e13de0f4e69ff8943c66744d3103b27/src/Umbraco.Cms.Targets/buildTransitive/Umbraco.Cms.Targets.targets#L32-L38

I recommend putting the node_modules and other source files outside of App_Plugins, perhaps in a Client folder, or even better in an RCL, where you get a wwwroot folder, which you can copy the compiled files to.

I realise that our documentation does not state this, so that is something we are going to look into getting added!

gregor-tusar-sowa commented 1 day ago

Thanks for looking into this. We will try to move things around a bit.