Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tsx folder in temp directory filled with a lot of files #8167

Open
mobeigi opened this issue Sep 11, 2024 · 0 comments
Open

Tsx folder in temp directory filled with a lot of files #8167

mobeigi opened this issue Sep 11, 2024 · 0 comments
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v3

Comments

@mobeigi
Copy link

mobeigi commented Sep 11, 2024

Link to reproduction

No response

Environment Info

$ cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload info

Binaries:      
  Node: 20.16.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.0.0-beta.97
  next: 15.0.0-canary.138
  @payloadcms/db-postgres: 3.0.0-beta.97
  @payloadcms/email-nodemailer: 3.0.0-beta.97
  @payloadcms/graphql: 3.0.0-beta.97
  @payloadcms/next/utilities: 3.0.0-beta.97
  @payloadcms/plugin-cloud: 3.0.0-beta.97
  @payloadcms/plugin-nested-docs: 3.0.0-beta.97
  @payloadcms/plugin-seo: 3.0.0-beta.97
  @payloadcms/richtext-lexical: 3.0.0-beta.97
  @payloadcms/translations: 3.0.0-beta.97
  @payloadcms/ui/shared: 3.0.0-beta.97
  react: 19.0.0-rc-e56f4ae3-20240830
  react-dom: 19.0.0-rc-e56f4ae3-20240830
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
  Available memory (MB): 65459
  Available CPU cores: 24

Describe the Bug

I am working with Payload V3 in development mode. I am on Windows.

After some days of development I noticed my Windows login speed getting slower and slower. It took my login speed from 1 second to 30 seconds to 2 minutes!

After some research this is caused by a huge number of files in my %TMP% directory. It turns out Payload is creating an insane amount of files in the %TMP% directory as you work with it in dev mode.

I have 900k files created by payload in a directory called tsx-Mo where Mo is my user profile name. All files are a few kb in size each but add up to be gigabytes in total file size due to sheer number of files.

Example of files created:

File name

Looks like: 17258-32e4dc7dfab8b9325c327612393a49ed992d5e71.txt

Example 1

{"code":"(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var getCollectionIDFieldTypes_exports={};__export(getCollectionIDFieldTypes_exports,{getCollectionIDFieldTypes:()=>getCollectionIDFieldTypes});module.exports=__toCommonJS(getCollectionIDFieldTypes_exports);function getCollectionIDFieldTypes({config,defaultIDType}){return config.collections.reduce((acc,collection)=>{const customCollectionIdField=collection.fields.find(field=>\"name\"in field&&field.name===\"id\");acc[collection.slug]=defaultIDType===\"text\"?\"string\":\"number\";if(customCollectionIdField){acc[collection.slug]=customCollectionIdField.type===\"number\"?\"number\":\"string\"}return acc},{})}__name(getCollectionIDFieldTypes,\"getCollectionIDFieldTypes\");0&&(module.exports={getCollectionIDFieldTypes});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,8MAIW,SAAS,0BAA0B,CAAE,OAAQ,aAAc,EAAG,CACrE,OAAO,OAAO,YAAY,OAAO,CAAC,IAAK,aAAa,CAChD,MAAM,wBAA0B,WAAW,OAAO,KAAM,OAAQ,SAAU,OAAS,MAAM,OAAS,IAAI,EACtG,IAAI,WAAW,IAAI,EAAI,gBAAkB,OAAS,SAAW,SAC7D,GAAI,wBAAyB,CACzB,IAAI,WAAW,IAAI,EAAI,wBAAwB,OAAS,SAAW,SAAW,QAClF,CACA,OAAO,GACX,EAAG,CAAC,CAAC,CACT,CAToB","names":[],"ignoreList":[],"sources":["C:\\Git\\mobeigi.com\\app\\node_modules\\payload\\dist\\utilities\\getCollectionIDFieldTypes.js"],"sourcesContent":[null]}}

Example 2

{"code":"(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var populateBreadcrumbs_exports={};__export(populateBreadcrumbs_exports,{populateBreadcrumbs:()=>populateBreadcrumbs});module.exports=__toCommonJS(populateBreadcrumbs_exports);var import_formatBreadcrumb=require(\"./formatBreadcrumb.js\");var import_getParents=require(\"./getParents.js\");const populateBreadcrumbs=__name(async(req,pluginConfig,collection,data,originalDoc)=>{const newData=data;const breadcrumbDocs=[...await(0,import_getParents.getParents)(req,pluginConfig,collection,{...originalDoc,...data})];const currentDocBreadcrumb={...originalDoc,...data};if(originalDoc?.id){currentDocBreadcrumb.id=originalDoc?.id}breadcrumbDocs.push(currentDocBreadcrumb);const breadcrumbs=breadcrumbDocs.map((_,i)=>(0,import_formatBreadcrumb.formatBreadcrumb)(pluginConfig,collection,breadcrumbDocs.slice(0,i+1)));return{...newData,[pluginConfig?.breadcrumbsFieldSlug||\"breadcrumbs\"]:breadcrumbs}},\"populateBreadcrumbs\");0&&(module.exports={populateBreadcrumbs});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,4MAAiC,iCACjC,sBAA2B,2BACpB,MAAM,oBAAsB,aAAO,IAAK,aAAc,WAAY,KAAM,cAAc,CACzF,MAAM,QAAU,KAChB,MAAM,eAAiB,CACnB,GAAG,QAAM,8BAAW,IAAK,aAAc,WAAY,CAC/C,GAAG,YACH,GAAG,IACP,CAAC,CACL,EACA,MAAM,qBAAuB,CACzB,GAAG,YACH,GAAG,IACP,EACA,GAAI,aAAa,GAAI,CACjB,qBAAqB,GAAK,aAAa,EAC3C,CACA,eAAe,KAAK,oBAAoB,EACxC,MAAM,YAAc,eAAe,IAAI,CAAC,EAAG,OAAI,0CAAiB,aAAc,WAAY,eAAe,MAAM,EAAG,EAAI,CAAC,CAAC,CAAC,EACzH,MAAO,CACH,GAAG,QACH,CAAC,cAAc,sBAAwB,aAAa,EAAG,WAC3D,CACJ,EArBmC","names":[],"ignoreList":[],"sources":["C:\\Git\\mobeigi.com\\app\\node_modules\\@payloadcms\\plugin-nested-docs\\dist\\utilities\\populateBreadcrumbs.js"],"sourcesContent":[null]}}

Reproduction Steps

  1. Setup Payload v3 project
  2. Start dev mode yarn dev and work with it for some itme
  3. Notice the build up of files in %TMP%
  4. Windows login process will become slower and slower as the files build up.

Adapters and Plugins

No response

@mobeigi mobeigi added status: needs-triage Possible bug which hasn't been reproduced yet v3 labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet v3
Projects
None yet
Development

No branches or pull requests

1 participant