Code Monkey home page Code Monkey logo

Comments (8)

pomber avatar pomber commented on July 28, 2024

I think I tried it and it works, but I may be wrong. It doesn't use fs if it's not available.

from lighter.

imownbey avatar imownbey commented on July 28, 2024

Oh great okay will try!

from lighter.

pomber avatar pomber commented on July 28, 2024

Oh great okay will try!

let me know how it goes

from lighter.

imownbey avatar imownbey commented on July 28, 2024

mmm it did not work (at least on vercel) but I dont remember why. Will update this thread when I retry it.

from lighter.

MaxLeiter avatar MaxLeiter commented on July 28, 2024

It doesn't seem to be working for me due to the (node) https module:

- error ./node_modules/.pnpm/@[email protected]/node_modules/@code-hike/lighter/dist/browser.esm.mjs:16:24
Module not found: Can't resolve 'https'

from lighter.

pomber avatar pomber commented on July 28, 2024

Strange, it should only import 'https' if 'fetch' isn't available. Conditional imports are a lie.

from lighter.

tom-sherman avatar tom-sherman commented on July 28, 2024

In cloudflare workers (and I presume Vercel as well, as they use the cloudflare runtime under the hood) you need to setup a binding to a WASM binary and then reference it.

See https://developers.cloudflare.com/workers/platform/web-assembly/javascript/

So without some bundler magic to replace the WASM import in the lighter code, I don't think it'll work right now.

from lighter.

pomber avatar pomber commented on July 28, 2024

v0.8.0 should fix this. At least for Vercel's edge.

I had problems with old versions of Next.js (they were ignoring the worker conditional export in lighter's package json), so try updating next.js first if you have problems.

from lighter.

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.