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

Importing aliased module #230

Closed
ashalfarhan opened this issue May 24, 2022 · 1 comment
Closed

Importing aliased module #230

ashalfarhan opened this issue May 24, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@ashalfarhan
Copy link

I have an issue where I can't import my module with typescript aliases in a Next.js typescript project.

// contentlayer.config.ts
import type * as H from 'hast';
import {
  makeSource,
  defineDocumentType,
  ComputedFields,
} from 'contentlayer/source-files';
import readingTime from 'reading-time';
import rehypeAutoHeadings from 'rehype-autolink-headings';
import rehypeSlug from 'rehype-slug';
import remarkGfm from 'remark-gfm';
import rehypeShiki from '@re-taro/rehype-shiki';
import { getHighlighter } from 'shiki';
import { getImgProps } from '@site/helpers'; // Here's the module
// tsconfig.json
{
  "compilerOptions": {
     // ...other of the config
    "paths": {
      "@site/*": ["./src/*"],
      "@content": ["./.contentlayer/generated"]
    }
  },
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    ".contentlayer/generated"
  ],
  "exclude": ["node_modules"]
}

contentlayer version: "^0.2.5"
next-contentlayer version: "^0.2.5"

When running

yarn contentlayer build

Here's what I got
Screenshot 2022-05-24 at 21 06 57

Is that possible to use path aliases with typescript to solve this?

Thanks in advance!

@schickling
Copy link
Collaborator

Thanks for opening this issue. Closing as duplicate of #238.

@schickling schickling closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2022
@schickling schickling added the duplicate This issue or pull request already exists label Jul 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants