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

Support for Next.JS projects #41

Open
GorvGoyl opened this issue Dec 11, 2020 · 4 comments
Open

Support for Next.JS projects #41

GorvGoyl opened this issue Dec 11, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@GorvGoyl
Copy link

Currently it doesn't work for Next.js project.

This is the error I get when previewing mdx file:

Unhandled Rejection (Error): React is not defined
w
lib/errors.ts:43:8
  40 |  */
  41 | const handleRuntimeError = (error: Error) => {
  42 |   hasRuntimeError = true;
> 43 |   throw new Error(error.message);
     |        ^  44 | };
  45 | 
  46 | export {
View compiled
(anonymous function)
evaluate.ts:134:4
  131 |   ExtensionHandle.reportPerformance(evaluationEndTime - evaluationStartTime);
  132 |   return evaluatedModule;
  133 | } catch(error) {
> 134 |   handleRuntimeError(error);
      |  ^  135 | } finally {
  136 |   evaluationProgress.value = EvaluationProgress.COMPLETED;
  137 | }
View compiled
▶ 5 stack frames were collapsed.
This screen is visible only in development. It will not appear if the app crashes in production.
Open your browser’s developer console to further inspect this error.
@pedroresende
Copy link

Any news about this ?

@xyc xyc added the enhancement New feature or request label Feb 15, 2022
@42arch
Copy link

42arch commented May 27, 2022

Next.js auto imported React in components. Seems like you should manually import React again in the component which is used in MDX.

import React from "react"

@sheehyjohn
Copy link

Hello .... I think I am experience this issue. Attempting to Preview .mdx files in a Next.js project in vsCode

@danadalis
Copy link

Hello .... I think I am experience this issue. Attempting to Preview .mdx files in a Next.js project in vsCode

In files.associations you mention the languageId to use for a particular file extension

"files.associations": {
"*.mdx": "markdown"
},

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

No branches or pull requests

6 participants