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

📝 more options that can be controlled from environment variables #190

Merged
merged 1 commit into from
Aug 29, 2016

Conversation

basarat
Copy link
Member

@basarat basarat commented Aug 29, 2016

From :

ts-node/src/index.ts

Lines 96 to 97 in 44c389e

cache: process.env.TS_NODE_CACHE,
cacheDirectory: process.env.TS_NODE_CACHE_DIRECTORY || join(tmpdir(), 'ts-node'),

I actually needed to disable cache for alm.tools integrated test runner (alm-tools/alm#181) otherwise I get errors like the following sometimes:

Cannot write file '/Users/syedb/REPOS/alm/src/$$ts-node$$/common/utils.js' because it would be overwritten by multiple input files.

😄 🌹

@coveralls
Copy link

coveralls commented Aug 29, 2016

Coverage Status

Coverage remained the same at 87.031% when pulling a19d9f6 on bas/memo into 94ac257 on master.

@blakeembrey
Copy link
Member

Thanks @basarat. Did you find out if those changes help you though, because that seems really odd. This is a TypeScript error and $$ts-node$$ is never actually used, it's purely there to avoid a different set of compiler errors (namely trying to override itself when using allowJs).

@blakeembrey blakeembrey merged commit d1222d9 into master Aug 29, 2016
@blakeembrey blakeembrey deleted the bas/memo branch August 29, 2016 07:42
@basarat
Copy link
Member Author

basarat commented Aug 29, 2016

Did you find out if those changes help you though

Thanks for the psychic debugging ❤️. Indeed it still happens. I'll track it down 🌹

@blakeembrey
Copy link
Member

If it helps, that error should be a TypeScript error. Definitely let me know what you find though 😄

@basarat
Copy link
Member Author

basarat commented Aug 30, 2016

I have the stack trace but haven't analysed it further:

/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:253
          throw new TSError(diagnosticList)
                ^
TSError: ⨯ Unable to compile TypeScript
Cannot write file '/Users/syedb/REPOS/alm/src/$$ts-node$$/server/workers/tested/runners/makeStack.js' because it would be overwritten by multiple input files. (5056)
../server/workers/tested/runners/makeStack.js: Emit skipped
    at getOutput (/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:253:17)
    at /Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:263:16
    at Object.compile (/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:398:17)
    at Module.m._compile (/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:299:46)
    at Module._extensions..js (module.js:422:10)
    at Object.require.extensions.(anonymous function) [as .js] (/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:302:14)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/syedb/REPOS/alm/src/server/workers/tested/runners/mochaInstrumenter.ts:27:1)
    at Module._compile (module.js:413:34)
    at Module.m._compile (/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:299:25)
    at Module._extensions..js (module.js:422:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/Users/syedb/REPOS/alm/node_modules/ts-node/src/index.ts:302:14)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at /Users/syedb/REPOS/alm/node_modules/mocha/lib/mocha.js:220:27
    at Array.forEach (native)
    at Mocha.loadFiles (/Users/syedb/REPOS/alm/node_modules/mocha/lib/mocha.js:217:14)
    at Mocha.run (/Users/syedb/REPOS/alm/node_modules/mocha/lib/mocha.js:485:10)
    at Object.<anonymous> (/Users/syedb/REPOS/alm/node_modules/mocha/bin/_mocha:403:18)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:146:18)
    at node.js:404:3

Doesn't happen all the time. Will report back once I have a better analysed...just wanted to share in case something struck you immediately 🌹

@blakeembrey
Copy link
Member

Unfortunately the stack trace isn't terribly useful here since it's just a result of TypeScript compilation. TypeScript doesn't actually throw any errors, so this is TypeScript diagnostics thrown by ts-node. At least it may be possible to search in TypeScript's codebase for the line.

I believe that error should only occur when an input file matches the output file by name, but I may be wrong. Seems odd that it would be an issue here though, since that directory is completely fake. I'll have to look more, feel free to make an issue so it doesn't get lost 😄

@blakeembrey
Copy link
Member

It seems like it should be from https://github.com/Microsoft/TypeScript/blob/0041d5ce7907f9ee974693ace54efd64afa1971a/src/compiler/program.ts#L2335. Seems odd, but is it possible this occurs on re-compilation somehow? Am I handling that incorrectly? So many user-land errors in TypeScript core I can't keep up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants