-
Notifications
You must be signed in to change notification settings - Fork 11
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
Wrong file returned - ATENTION #13
Comments
@Deathrage interesting, that seem strange as Could you provide a reproduction, I can gladly debug it then. |
It seems like Typescript related issue. I am testing with typescript default settings through TSNODE. Typescript:
This logs /func.ts. (incorrect) Javascript (not result of TSC, I wrote vanila counterpart as test):
This logs /index.js. (correct) Firstly I suspected it might be related to TS-NODE as I use it during development but after transpiling to JS and executing JS directly the issue persists. TSC does not do any kind of bundling, it just spawns transpiled file next to ts file. It might be realted to the way how TSC handles transpilation of ES6 to CommonJS. Code written in vanila JS works well. Version of TSC: 3.3.3 |
`// root/index.js
module.exports = function() { return getCallerFile(); }
// root/dir/app.js
const func = require('../index.js');
func(); // returns root/index.js`
Firstly encourntered this when using TS-NODE. It occurs in node too. Caller file is app.js yet definition file index.js is returned.
The text was updated successfully, but these errors were encountered: