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

Astro 2 upgrade gives Typescript errors re. missing MDX properties: rawContent and compiledContent #6021

Closed
1 task
madrus opened this issue Jan 29, 2023 · 1 comment · Fixed by #6024
Closed
1 task

Comments

@madrus
Copy link

madrus commented Jan 29, 2023

What version of astro are you using?

2.0.2

Are you using an SSR adapter? If so, which one?

none

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

After upgrading my project to latest Astro 2.0.2 and upgrading all the @astrojs/* plugins, also @astrojs/mdx, running tsc --noEmit results in the following missing properties:

tsc --noEmit
node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/client-base.d.ts:
115:31 - error TS2339: Property 'rawContent' does not exist on type 'MDX'.

115  export const rawContent: MDX['rawContent'];
                                  ~~~~~~~~~~~~
node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/client-base.d.ts:
116:36 - error TS2339: Property 'compiledContent' does not exist on type 'MDX'.

116  export const compiledContent: MDX['compiledContent'];
                                       ~~~~~~~~~~~~~~~~~
Found 2 errors in the same file, starting at: node_modules/.pnpm/[email protected]_@[email protected]/node_modules/astro/client-base.d.ts:115

The errors refer to astro/client-base.d.ts which has the following code:

astro-2-mdx-error

And indeed, these two properties are omitted from MDXInstance in astro.d.ts:

export type MDXInstance<T extends Record<string, any>> = Omit<MarkdownInstance<T>, 'rawContent' | 'compiledContent'>;

However, the project itself runs fine with astro dev command.

Link to Minimal Reproducible Example

n/a

Participation

  • I am willing to submit a pull request for this issue.
@madrus madrus changed the title Astro 2 upgrade results in missing MDX properties: rawContent and compiledContent Astro 2 upgrade give Typescipt errors re. missing MDX properties: rawContent and compiledContent Jan 29, 2023
@madrus madrus changed the title Astro 2 upgrade give Typescipt errors re. missing MDX properties: rawContent and compiledContent Astro 2 upgrade gives Typescipt errors re. missing MDX properties: rawContent and compiledContent Jan 29, 2023
@madrus madrus changed the title Astro 2 upgrade gives Typescipt errors re. missing MDX properties: rawContent and compiledContent Astro 2 upgrade gives Typescript errors re. missing MDX properties: rawContent and compiledContent Jan 29, 2023
@madrus
Copy link
Author

madrus commented Jan 30, 2023

Great news! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant