-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Chore: Convert alias path imports to relative imports #950
base: master
Are you sure you want to change the base?
Conversation
This fixes the issue with built typescript artifacts throwing "Cannot find module 'src/types' or its corresponding type declarations" errors. See garmeeh#942
Hey @oleg-semyonov sorry about the delay. (a long one 😟) Could you give me an example of file that this is happening with? I use next-seo on all of my projects and haven't had an issue so wondering is it a specific component giving some trouble. |
Hey @garmeeh, sorry for long reply as well, somehow missed the notification 😕 The project that's having the issues is this one: https://github.com/prezly/theme-kit-nextjs Just today I tried removing the rule, but the errors are still there when I build the library. I've got the latest version (5.5.0) installed. Here's a link to project's tsconfig.json. Here are just some of many errors I get from |
@garmeeh @oleg-semyonov I have the same issue on my end and I cannot update the // tsconfig
{
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": true,
"skipLibCheck": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"alwaysStrict": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",
"allowUnusedLabels": false,
"declaration": true,
"experimentalDecorators": true,
"inlineSources": true,
"noImplicitAny": false,
"noImplicitReturns": true,
"noUnusedParameters": true,
"sourceMap": true,
"strictFunctionTypes": false,
"baseUrl": ".",
"incremental": true,
"paths": {
"@/*": ["src/*"]
}
},
"include": ["./common.d.ts", "./src", "./jest-setup.ts", "middleware.ts"],
"exclude": ["node_modules", "bin"]
}
|
@garmeeh 👋🏼 Any news on this one? Basically what's happening is that TypeScript is unable to resolve absolute imports pointing to, for example, You can find an example on This causes components like |
Just a quick message to bump this, as I think this fix might also resolve an issue I'm facing where the type checking for FAQ questions isn't working because import type { Question } from 'src/types';
import { JsonLdProps } from './jsonld';
export interface FAQPageJsonLdProps extends JsonLdProps {
mainEntity: Question[];
}
declare function FAQPageJsonLd({ type, keyOverride, mainEntity, ...rest }: FAQPageJsonLdProps): JSX.Element;
export default FAQPageJsonLd; I'm using |
+1 this is breaking for me too |
+1, just bumping here |
This fixes the issue with built typescript artifacts throwing "Cannot find module 'src/types' or its corresponding type declarations" errors.
See #942
Description of Change(s):
src/*
imports with relative imports.https://github.com/garmeeh/next-seo/blob/master/CONTRIBUTING.md