Giter Club home page Giter Club logo

Comments (7)

samijaber avatar samijaber commented on June 11, 2024 3

if you try https://github.com/BuilderIO/builder/releases/tag/%40builder.io%2Fsdk-vue%400.11.3, you should be able to import @builder.io/sdk-vue/edge which will not import isolated-vm. This should fix your issue.

from builder.

behzadsp avatar behzadsp commented on June 11, 2024

I had the same issue but its fixed with running the npm update command, but now im getting another error in browser console and the builder.io component is not rendering:
Uncaught (in promise) TypeError: The specifier “@builder.io/sdk-vue” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

from builder.

20x-dz avatar 20x-dz commented on June 11, 2024

I had the same issue but its fixed with running the npm update command

Care to share some details? Node version? Maybe create a PR on my Nuxt example for reproducibility? Thx!

from builder.

samijaber avatar samijaber commented on June 11, 2024

The issue is that your deployment is using the Node bundle instead of the Edge bundle:

  • node bundle: @builder.io/sdk-vue/lib/node
  • edge bundle: @builder.io/sdk-vue/lib/edge

I am not sure why that is happening, since edge-light (Vercel's environment name) is configured to use the correct bundle in the package.json:

".": {
"node": {
"import": "./lib/node/index.js",
"require": "./lib/node/index.cjs"
},
"browser": {
"import": "./lib/browser/index.js",
"require": "./lib/browser/index.cjs"
},
"edge-routine": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"workerd": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"deno": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"lagon": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"netlify": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"edge-light": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"bun": {
"import": "./lib/edge/index.js",
"require": "./lib/edge/index.cjs"
},
"electron": {
"import": "./lib/node/index.js",
"require": "./lib/node/index.cjs"
},
"default": {
"import": "./lib/browser/index.js",
"require": "./lib/browser/index.cjs"
}
}

My best guess is that there is an issue either in Nuxt or Vercel's build configuration such that it is grabbing the wrong bundle. Not sure how to go about fixing that unfortunately.

What I can do is add an /edge export subpath so that you can explicitly import the edge bundle in your webapp.

from builder.

20x-dz avatar 20x-dz commented on June 11, 2024

if you try https://github.com/BuilderIO/builder/releases/tag/%40builder.io%2Fsdk-vue%400.11.3, you should be able to import @builder.io/sdk-vue/edge which will not import isolated-vm. This should fix your issue.

OMG, it does! Thanks a lot! 🥳 💯 👍 🥇

Any idea where I should open an issue to have the subpath export fixed? Vercel? Vite? Nuxt/Nitro? …

from builder.

samijaber avatar samijaber commented on June 11, 2024

@20x-dz I am honestly not sure! One of those tools is the culprit, but I don't know which 😅

from builder.

khiemtong avatar khiemtong commented on June 11, 2024

@samijaber We're hosting on AWS Amplify and running into this with @builder.io/[email protected]

Error: Cannot find module 'isolated-vm'

Our app on AWS Amplify is hosted on a full node runtime running in lambdas, I did try the /edge subpath and it resolved the issue but /edge runtime is not an option for us (breaks components of the app).

Any insights on how we could resolve this?

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.