Skip to content
Discussion options

You must be logged in to vote

On 9.5.2 with my tsconfig.json and pages setup like this, it works:

{
    "compilerOptions": {
      "baseUrl": ".",
      "paths": {
        "@/components/*": ["./src/components/*"]
      }
    }
  }

src/pages/index.js

import Test from '@/components/test';

export default function Home() {
  return (
    <div>
      <Test />
    </div>
  );
}

src/components/test.js

export default function Test() {
  return <p>test</p>
}

Could you import your AppHeader via import AppHeader from '@/components/AppHeader'; instead of import AppHeader from '@/src/components/AppHeader';?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mhesham32
Comment options

@jamesmosier
Comment options

Answer selected by mhesham32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants