timlrx / contentlayer2

Contentlayer turns your content into data - making it super easy to import MD(X) and CMS content in your app
https://contentlayer.dev
MIT License
174 stars 11 forks source link

Individual declarations in merged declaration 'Blog' must be all exported or all local.ts(2395) #22

Closed yangchristina closed 4 months ago

yangchristina commented 4 months ago

Am getting Individual declarations in merged declaration 'Blog' must be all exported or all local.ts(2395) from:

import type { Blog } from 'contentlayer/generated'

When using

import { Blog } from 'contentlayer/generated'

I get: Individual declarations in merged declaration 'Blog' must be all exported or all local.ts(2395) Import 'Blog' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled.

"contentlayer2": "0.4.6", "next-contentlayer2": "0.4.6"

Using same contentlayer.config.ts file as in https://github.com/timlrx/tailwind-nextjs-starter-blog but I added the blog to an existing repository, so I'm not sure if I have it setup right.

Edit: Renaming fixed it, which confuses me, since the export const Blog being exported is not a type

import type { Blog as BlogType } from 'contentlayer/generated'