react-runner icon indicating copy to clipboard operation
react-runner copied to clipboard

Minified React Error w/ Next.js and Vercel

Open haaarshsingh opened this issue 2 years ago • 7 comments

I've deployed react-runner into production in Vercel using Next.js, but for some reason I get this minified react error logged into the console and the code editor doesn't run properly as the output is blank.

Uncaught Error: Minified React error #418; visit https://reactjs.org/docs/error-decoder.html?invariant=418 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at lg (react-dom.production.min.js:132:269)
    at i (react-dom.production.min.js:294:336)
    at oD (react-dom.production.min.js:281:375)
    at react-dom.production.min.js:281:315
    at oO (react-dom.production.min.js:281:315)
    at ox (react-dom.production.min.js:269:193)
    at x (scheduler.production.min.js:14:181)
    at MessagePort.T (scheduler.production.min.js:15:101)

For context, this works perfectly fine in dev. I'll attach screenshots below. The first is in development, the second in production:

screenshot in dev, with a button screenshot in product, with no button

haaarshsingh avatar Dec 28 '22 21:12 haaarshsingh

https://reactjs.org/docs/error-decoder.html/?invariant=418 please check what cause the mismatch during hydration, I guess you should get some errors in your console in dev env as well

nihgwu avatar Dec 28 '22 22:12 nihgwu

Hey @nihgwu, While running my application in development, there are no errors logged into the console. It's only in production, and I've linked the error above.

You can check out my application in production at lab.hxrsh.in/posts/toasts for more information if that's helpful.

haaarshsingh avatar Dec 30 '22 19:12 haaarshsingh

@harshhhdev still have no idea, but this error https://reactjs.org/docs/error-decoder.html/?invariant=423 looks weird because there is ErrorBoundary in react-runner

nihgwu avatar Dec 30 '22 19:12 nihgwu

Would you have any ideas on how to go about fixing it @nihgwu? Any other information I can provide? I'd be glad to add you into the repository.

haaarshsingh avatar Jan 02 '23 17:01 haaarshsingh

@harshhhdev If you think it's fine then I'm happy to debug with the source code

nihgwu avatar Jan 02 '23 20:01 nihgwu

Hey, @nihgwu Sorry for the delay. I've added you onto it. You'll need to accept the invite in your email.

You can find it at harshhhdev/experiments.

haaarshsingh avatar Jan 13 '23 02:01 haaarshsingh

@harshhhdev looks more like a bug in Next

this will trigger the error

const Editor = () => {
  return (
    <div>
      <Runner code={initial} />
    </div>
  );
};

export default function Page() {
  return <Editor />;
}

while this doesn't

const Editor = () => {
  return (
    <Runner code={initial} />
  );
};

export default function Page() {
  return <Editor />;
}
import { Runner } from "react-runner";

const initial = `() => {
  return (
    <button
      onClick={() => {
        console.log('hello')
      }}
    >
      Add Toast
    </button>
  )
}`;

const Editor = () => {
  return (
    <Runner code={initial} />
  );
};

export default function Page() {
  return <Editor />;
}

nihgwu avatar Jan 13 '23 18:01 nihgwu