-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
BUG :: tsc-alias making relative a package.json defined lib #214
Comments
Debugging I found the problem! I just renamed the file from @izumiya @mgcrea @nicholas-ochoa @Jokero I'm closing this since I found the problem, but I would suggest trying to reproduce it, since it's a bug. It seems that when you import a lib in a file with the same name as the lib (and maybe on the root of the project) it tries to add the |
I think this should be reopened, as it seems to be an actual bug in I have encountered this while working on a backend typescript project. I have this code in a file // scr/utils/zod.ts
// defines extra helpers and utility functions for the zod library
import { z } from 'zod' // import the library
export function arrayWithOnlyValidElements<T extends z.ZodTypeAny>(
itemSchema: T,
) {
const catchValue = {} as never;
return z
.array(itemSchema.catch(catchValue))
.transform((arr) => arr.filter((el) => el !== catchValue))
.catch([]);
} After running > head -n 1 dist/utils/zod.js
import { z } from 'zod.js' Which is incorrect. This is with Having local modules with the same name as some dependency, in a subdir like |
Context
package.json
yarn.lock
Original TS file
JS code (Compiled by TSC)
tsc-alias output
Expectations
tsconfig.json
More context
It's strange since I have other libs and default imports but it's only happening in passport import!
The text was updated successfully, but these errors were encountered: