Giter Club home page Giter Club logo

Comments (13)

riceboyler avatar riceboyler commented on June 19, 2024 2

I'm seeing a similar issue after moving to Gen 2 React SDK, but I'm running on Next.js v14.1 and I'm only seeing these errors locally. I'm using Node 18, so isolated-vm shouldn't be an issue here, though I am running on an M1 Macbook Pro.

At least I'm only seeing issues locally, our preview builds on Vercel (haven't pushed Gen 2 to production yet) seem to be performing just as well as on Gen 1.

@tgaribal ☝️ This is the same issue I emailed you about yesterday.

from builder.

samijaber avatar samijaber commented on June 19, 2024

Where are you deploying Remix? Remix encourages you to deploy to an edge runtime, which inherently does not support the isolated-vm package, as it uses NodeJS internals.

If you are deploying to an edge runtime, you need to update your imports to @builder.io/sdk-react/edge, so that they do not rely on isolated-vm at all. We are working on updating our documentation regarding the Gen2 SDK to reflect this information.

from builder.

MaximeGratens avatar MaximeGratens commented on June 19, 2024

We are deploying on fly.io using node20.

I just tried to deploy the Remix project on Vercel Edge using the Vercel preset for Remix and @builder.io/sdk-react/edge. However, the result was an error: [GET] /en reason=EDGE_FUNCTION_INVOCATION_TIMEOUT, status=504, user_error=true.

from builder.

MaximeGratens avatar MaximeGratens commented on June 19, 2024

Same on Cloudflare page, with import {Content, fetchOneEntry} from "@builder.io/sdk-react"; and import {Content, fetchOneEntry} from "@builder.io/sdk-react/edge"; and I'm getting Worker exceeded resource limits

from builder.

MaximeGratens avatar MaximeGratens commented on June 19, 2024
const e = safeDynamicRequire("isolated-vm");
  
  return new e.Isolate({
    memoryLimit: 128
  }).createContextSync();

In my side e undefined, I think it's because of this

EDIT : https://www.builder.io/c/docs/guides/connecting-api-data#using-the-react-sdk-with-ssr-on-cloud-hosting-services

I tried to add

const context = isolate.createContextSync();
Builder.setServerContext(context);

inside the loader of my root.tsx but now I can't deploy to the edge :

The Edge Function "*" is referencing unsupported modules:
        - isolated-vm: ./out/isolated_vm

from builder.

ruben-trdj avatar ruben-trdj commented on June 19, 2024

We are also facing this issue with remix sdk when we migrate from 1 to 2

from builder.

samijaber avatar samijaber commented on June 19, 2024

Hey folks. I wanted to provide some updates:

  • When it comes to deploying a Nextjs Pages app on Vercel, we have identified an issue on the side of Next/Vercel and are waiting for a fix: vercel/next.js#63492. The SDK seems unable to import the isolated-vm package when it's deployed on Vercel. We are actively investigating this and looking for workarounds. We know that pre-rendering the page seems to resolve the issue, and the issue does not seem to reproduce in a Next App router app.
  • We have recently added a caching layer to our dynamic bindings evaluation: https://github.com/BuilderIO/builder/blob/main/packages/sdks/output/react/CHANGELOG.md#1012 . This should greatly enhance the performance of the SDK, which might be the root cause behind the Worker exceeded resource limits issues.

We are still investigating further and will let you know when we have a solution

from builder.

MaximeGratens avatar MaximeGratens commented on June 19, 2024

Hey @samijaber ,

I just deploy on our staging server on fly (performance@2x) the new sdk without the RUN grep -rli 'arm64' * | xargs -i@ sed -i 's/arm64/x64/g' @

So, now the server is not crashing! but the performance are still not acceptable in a seo pespective...
image

The output of the log is still the same : [Builder.io]: Failed code evaluation: Cannot read properties of undefined (reading 'Isolate') {

from builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.