Comments (8)
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.
Oh great okay will try!
from lighter.
Oh great okay will try!
let me know how it goes
from lighter.
mmm it did not work (at least on vercel) but I dont remember why. Will update this thread when I retry it.
from lighter.
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.
Strange, it should only import 'https' if 'fetch' isn't available. Conditional imports are a lie.
from lighter.
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.
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)
- fenchJSON must use external network HOT 3
- Add highlightSync
- Add getThemeColors HOT 2
- Update vscode-textmate and onigurama
- Possible to see if a language is available? HOT 2
- Annotations for languages without comment syntax HOT 2
- Use CSS classes instead of colors HOT 3
- Error with non extensible themes HOT 1
- JSX comment syntax and annotations HOT 1
- Escape annotations HOT 4
- Use ansi codes to highlight `terminal` code
- Support static builds in Next.js app directory HOT 1
- Allow the user to control the process of loading grammars & themes HOT 8
- Support Gatsby Partial Hydration HOT 5
- Fix terminal out of memory HOT 1
- `from-css` themes don't work with `scopes: true` HOT 1
- build error on vite
- Regex containing `)` or `]` HOT 1
- crashes with Unknown language HOT 1
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 lighter.