Skip to content

error when using npm run dev (maybe caused by proxies) #61

Closed
@zeozcb

Description

@zeozcb
> [email protected] dev
> concurrently --ks SIGKILL -n "Client,Server" "npm run dev:client" "npm run dev:server"

[Server]
[Server] > [email protected] dev:server
[Server] > cross-env NODE_ENV=development tsx watch server/
[Server]
[Client]
[Client] > [email protected] dev:client
[Client] > cross-env NODE_ENV=development vite
[Client]
[Client]
[Client]   VITE v5.4.14  ready in 664 ms
[Client]
[Client]   ➜  Local:   http://localhost:5173/
[Client]   ➜  Network: use --host to expose
[Server] file:///C:/Users/matve/Desktop/mikumikubeam/server/fileLoader.ts:1
[Server] var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:true});import fs from"fs";import{join}from"path";const currentPath=__name(()=>{const path=process.cwd();return path==="/"?".":path},"currentPath");const loadFileLines=__name(filePath=>{try{return fs.readFileSync(filePath,"utf8").split("\n").map(line=>line.trim()).filter(Boolean).filter(line=>!line.startsWith("#"))}catch(err){console.error(`Error reading ${filePath}:`,err);return[]}},"loadFileLines");function loadUserAgents(){return loadFileLines(join(currentPath(),"data/uas.txt"))}__name(loadUserAgents,"loadUserAgents");function loadProxies(){const lines=loadFileLines(join(currentPath(),"data/proxies.txt"));const authProxiesRegEx=new RegExp(/^(http|https|socks4|socks5|):\/\/(\S+:\S+)@((\w+|\d+\.\d+\.\d+\.\d+):\d+)$/,"g");return lines.map(line=>{const[protocol,loginInfo]=line.split("://");if(authProxiesRegEx.test(line)){const[auth,addr]=loginInfo.split("@");const[user,pass]=auth.split(":");const[host,port]=addr.split(":");return{protocol,host,port:parseInt(port),username:user,password:pass}}else{const[host,port]=loginInfo.split(":");return{protocol,host,port:parseInt(port)}}})}__name(loadProxies,"loadProxies");export{currentPath,loadProxies,loadUserAgents};
[Server]








[Server]
[Server] TypeError: Cannot read properties of undefined (reading 'split')
[Server]     at <anonymous> (c:\Users\matve\Desktop\mikumikubeam\server\fileLoader.ts:45:38)
[Server]     at Array.map (<anonymous>)
[Server]     at loadProxies (c:\Users\matve\Desktop\mikumikubeam\server\fileLoader.ts:35:16)
[Server]     at <anonymous> (c:\Users\matve\Desktop\mikumikubeam\server\index.ts:37:17)
[Server]     at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
[Server]
[Server] Node.js v18.16.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions