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

eval("require")(PACKAGE) fails on Vercel in Pages router, unless pre-rendering. #63492

Closed
samijaber opened this issue Mar 19, 2024 · 3 comments
Closed
Labels
bug Issue was opened via the bug report template. locked

Comments

@samijaber
Copy link
Contributor

Link to the code that reproduces this issue

https://github.com/samijaber/nextjs-monorepo/

To Reproduce

see https://vercel.com/sami/nextjs-monorepo-nextjs-pages for example of deploy

Current vs. Expected behavior

I expect app to deploy successfully, but it does not

Provide environment information

N/A (this is a Vercel env issue, not a local issue)

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

My linked repo includes a pages router and an app router example.

Things to note:

Removing this getServerSideProps will make the app successfully run on Vercel.

@feedthejim
Copy link
Contributor

@samijaber can you detail what's the expected breakage?

@samijaber
Copy link
Contributor Author

Closing this issue as I found a workaround.

import { Head, Html, Main, NextScript } from "next/document";

// import that isn't technically used
import ivm from "isolated-vm";

export default function Document() {
  return (
    <Html lang="en">
      <Head />
      <body>
        <Main />
        <NextScript />
      </body>
    </Html>
  );
}

Copy link
Contributor

github-actions bot commented Apr 5, 2024

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot added the locked label Apr 5, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template. locked
Projects
None yet
Development

No branches or pull requests

2 participants