Source and destination must not be the same

❯ npm run watch

> rbxtsc -w

[3:26:39 PM] Starting compilation in watch mode...

/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:172
throw e;
^

Error: Source and destination must not be the same.
at Object.checkPathsSync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/util/stat.js:75:13)
at Object.copySync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
at copyItem (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyItem.js:11:24)
at /Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:9:37
at benchmarkIfVerbose (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Shared/util/benchmark.js:24:9)
at copyFiles (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:7:40)
at runInitialCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:77:35)
at runCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:152:24)
at FSWatcher.<anonymous> (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:209:26)
at Object.onceWrapper (node:events:621:28)

Node.js v23.0.0
❯ npm run watch

> rbxtsc -w

[3:26:39 PM] Starting compilation in watch mode...

/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:172
throw e;
^

Error: Source and destination must not be the same.
at Object.checkPathsSync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/util/stat.js:75:13)
at Object.copySync (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/node_modules/fs-extra/lib/copy/copy-sync.js:27:38)
at copyItem (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyItem.js:11:24)
at /Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:9:37
at benchmarkIfVerbose (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Shared/util/benchmark.js:24:9)
at copyFiles (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/copyFiles.js:7:40)
at runInitialCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:77:35)
at runCompile (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:152:24)
at FSWatcher.<anonymous> (/Users/myusername/Desktop/roblox-test/node_modules/roblox-ts/out/Project/functions/setupProjectWatchProgram.js:209:26)
at Object.onceWrapper (node:events:621:28)

Node.js v23.0.0
22 Replies
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
Where would that be located?
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
Oh sorry I misunderstood what you meant by
output of the tsconfig.json
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
I haven't changed anything about the template. I'm also using npm 10.9.0
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
I'm on a apple silicon macbook. I've tried on windows and intel macbook and they work. Do you think this could be related and I might be SOL?
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
I followed those instructions and it got me here. I think I'll just try a manual installation using a different package manager. Thanks!
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
Same problem with starting a bare bones game template project with just roblox ts. I think this might be an apple silicon issue.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
Yes, the issue is coming from the fs-extra dependency after running any of the build or watch commands.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
No, same error
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
I think this is a larger issue with the difference in cpu architecture as fs-extra deals with paths. It's ok, I don't think either of us can solve this issue.
Unknown User
Unknown User8mo ago
Message Not Public
Sign In & Join Server To View
PoppingPopper
PoppingPopperOP8mo ago
Tested it differently with dirty debugging, It says they're both 'src' Can try your way later
PoppingPopper
PoppingPopperOP4mo ago
Still having this issue. If you have time, I've logged the value of item
/Users/foouser/Desktop/roblox-test-project/src
/Users/foouser/Desktop/roblox-test-project/src
Getting this error on an M3 cpu Macbook. Using npm, bun produced the same results. Pretty sure this is something deeper with fs-extra.
No description
PoppingPopper
PoppingPopperOP4mo ago
Looks like there is a weird thing going on here I printed it out differently
function copyItem(data, pathTranslator, item) {
console.log("DEBUG START")
console.log("src: " + item)
console.log("dest: " + pathTranslator.getOutputPath(item))
console.log("DEBUG END")
fs_extra_1.default.copySync(item, pathTranslator.getOutputPath(item), {
function copyItem(data, pathTranslator, item) {
console.log("DEBUG START")
console.log("src: " + item)
console.log("dest: " + pathTranslator.getOutputPath(item))
console.log("DEBUG END")
fs_extra_1.default.copySync(item, pathTranslator.getOutputPath(item), {
DEBUG START
src: /Users/foouser/Desktop/roblox-test-project/src
dest: /Users/foouser/Desktop/roblox-test-project/src
DEBUG END
DEBUG START
src: /Users/foouser/Desktop/roblox-test-project/src
dest: /Users/foouser/Desktop/roblox-test-project/src
DEBUG END
Shouldn't dest have gone to /out?
{
"compilerOptions": {
// required
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"jsx": "react",
"jsxFactory": "Roact.createElement",
"jsxFragmentFactory": "Roact.createFragment",
"module": "commonjs",
"moduleResolution": "Node",
"noLib": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"moduleDetection": "force",
"strict": true,
"target": "ESNext",
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],

// configurable
"rootDir": "src",
"outDir": "out",
"baseUrl": "src",
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",

"plugins": [{ "transform": "rbxts-transformer-flamework" }]
}
}
{
"compilerOptions": {
// required
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"jsx": "react",
"jsxFactory": "Roact.createElement",
"jsxFragmentFactory": "Roact.createFragment",
"module": "commonjs",
"moduleResolution": "Node",
"noLib": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"moduleDetection": "force",
"strict": true,
"target": "ESNext",
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],

// configurable
"rootDir": "src",
"outDir": "out",
"baseUrl": "src",
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",

"plugins": [{ "transform": "rbxts-transformer-flamework" }]
}
}
It's a folder I can manually get it to work if I hardcode the dest path lol!

Did you find this page helpful?