You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can get the right value ({title: "hello world"}) in the console but there is always a ts error tell me:
Module '"@/content/post.mdx"' has no exported member 'frontmatter'. Did you mean to use 'import frontmatter from "@/content/post.mdx"' instead?ts(2614)
The error disappeared after running Restart typescript server but appeared again when I change something of this file.
Current vs. Expected behavior
No typescript error ts(2614)
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6000
Available memory (MB): 32768
Available CPU cores: 10
Binaries:
Node: 22.6.0
npm: 10.8.2
Yarn: 1.22.19
pnpm: 9.11.0
Relevant Packages:
next: 14.2.13 // There is a newer version (14.2.14) available, upgrade recommended!
eslint-config-next: 14.2.13
react: 18.3.1
react-dom: 18.3.1
typescript: 5.6.2
Next.js Config:
output: N/A
⚠ There is a newer version (14.2.14) available, upgrade recommended!
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
Which area(s) are affected? (Select all that apply)
Markdown (MDX)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I tried several methods but none worked.
Restart nextjs app
Clear node_modules and .next folder and reinstall
Add mdx.d.ts's path to include of tsconfig.json
The text was updated successfully, but these errors were encountered:
Link to the code that reproduces this issue
https://github.com/hallee9000/mdx-types-issue
To Reproduce
remark-frontmatter
andremark-mdx-frontmatter
plugin innext.config.mjs
mdx.d.ts
file insrc
to custom types for mdx filesmdx
file inpage.tsx
src/content/post.mdx
file:src/app/page.tsx
file:I can get the right value (
{title: "hello world"}
) in the console but there is always a ts error tell me:The error disappeared after running
Restart typescript server
but appeared again when I change something of this file.Current vs. Expected behavior
No typescript error
ts(2614)
Provide environment information
Which area(s) are affected? (Select all that apply)
Markdown (MDX)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I tried several methods but none worked.
node_modules
and.next
folder and reinstallmdx.d.ts
's path toinclude
oftsconfig.json
The text was updated successfully, but these errors were encountered: