Comments (13)
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.
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.
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.
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.
const e = safeDynamicRequire("isolated-vm");
return new e.Isolate({
memoryLimit: 128
}).createContextSync();
In my side e undefined, I think it's because of this
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.
We are also facing this issue with remix sdk when we migrate from 1 to 2
from builder.
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.
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...
The output of the log is still the same : [Builder.io]: Failed code evaluation: Cannot read properties of undefined (reading 'Isolate') {
from builder.
Hello,
Any idea on how we can help you on this?
from builder.
Hello, any news about this?
from builder.
hey @MaximeGratens, we are currently investigating the problem and will update this issue when we have found a resolution.
from builder.
We have released v1.0.21 of the React Gen 2 SDK with a fix regarding this issue. Read the changelog carefully for details: https://github.com/BuilderIO/builder/blob/main/packages/sdks/output/react/CHANGELOG.md#1021
There is also a documentation page up explaining how to use the workaround: https://www.builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
@MaximeGratens The timeouts you were seeing were a separate issue tied to the usage of a global fetch
in fetchOneEntry
. The Remix integration docs will be improved soon, along with a Remix example highlighting how you can resolve it. For reference, you need to explicitly provide the remix WebFetch implementation as a fetch
prop:
import { fetch as webFetch } from "@remix-run/web-fetch";
export const loader = async ({ params, request }: LoaderFunctionArgs) => {
const page = await fetchOneEntry({
/***/
fetch: webFetch,
});
//...
};
This will be thoroughly explained in our integration docs for Remix soon.
I am closing this issue, but feel free to update it with any relevant information if the problem persists on your end.
from builder.
Hello @samijaber ,
Thank for all we migrated all our projects with the new sdk and it's far better.
In production since the migration, our apps are crashing because the ram and cpu is used at 100%
Also, we are still having this log and it's killing our log output : 2024-04-24T08:51:21.766 app[9080292a0d4518] cdg [info] [Builder.io]: Skipping evaluation of empty code block.
EDIT: I just saw the 1.0.23 ahah!
from builder.
Related Issues (20)
- Critical problem with the <Columns> component when using @builder.io/react-sdk HOT 2
- Using Next.js App Dir with Builder V2 HOT 2
- Page with data from builder are slow / crashing HOT 7
- Critical memory issue since 1.0.21 HOT 15
- Missing `folded` for `object` Input [typescript]
- Problem with translations link on block url HOT 2
- "isolated-vm import error" on Vercel with Nuxt HOT 1
- TypeScript readonly error
- Next.js 14 App Router using sdk-react-nextjs and Contentful
- React SDK wrong promises resolutions for parallel requests
- Visual editor is failing on trail plan HOT 1
- makeStateKey deprecation causes builder.io not to build in an Angular 18 project HOT 5
- Allow astro components to be registered by Builder.io HOT 1
- Node 22 compatibility HOT 1
- Request to switch Solid SDK dependency solid-styled-components with solid-styled
- Getting "gyp ERR! UNCAUGHT EXCEPTION" when installing "@builder.io/react": "3.0.8"
- Hydration error on Remix
- Feature request: disable client-side tracking via Pixel
- Angular SDK Gen 2 release estimate? Current branch of dev? HOT 2
- Problem with save template and use template HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from builder.