Cannot work with hono + Cloudflareworkers
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Describe the bug
[wrangler:inf] GET / 500 Internal Server Error (27ms)
✘ [ERROR] TypeError: Cannot read properties of undefined (reading 'buffer')
at createWasm
(file:///Users/didi/Desktop/work/cofo-workers/node_modules/.pnpm/@[email protected]/node_modules/@shikijs/core/dist/index.mjs:4629:47)
at async main
(file:///Users/didi/Desktop/work/cofo-workers/node_modules/.pnpm/@[email protected]/node_modules/@shikijs/core/dist/index.mjs:4632:5)
at async _load
(file:///Users/didi/Desktop/work/cofo-workers/node_modules/.pnpm/@[email protected]/node_modules/@shikijs/core/dist/index.mjs:4929:23)
at async Array.<anonymous>
(file:///Users/didi/Desktop/work/cofo-workers/packages/shiki/src/index.ts:10:3)
at async jsonError
(file:///Users/didi/Desktop/work/cofo-workers/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/wrangler/templates/middleware/middleware-miniflare3-json-error.ts:22:10)
Reproduction
https://stackblitz.com/edit/stackblitz-starters-szxgur?file=src%2Findex.ts
Contributes
- [ ] I am willing to submit a PR to fix this issue
- [ ] I am willing to submit a PR with failing tests
https://shiki.zouhangoo7241.workers.dev/
I've been trying to do this too, and I'll also add that 7MB is a big yikes for cloudflare.
I've been trying to do this too, and I'll also add that 7MB is a big yikes for cloudflare.
Does it work?
@zouhangwithsweet Hey! Yeah! Here's an example - https://github.com/elliotberry/shiki-with-just-nord-json-support. I used ESBuild to pull out just the parts I needed, and then used the bundle on workers. Let me know if you have any thoughts/questions
@elliotberry Have you deployed your code on Cloudflare workers ?
This is also impacting https://github.com/shellscape/jsx-email/issues/82
CF does not support inline wasm, you need to import the .wasm file to get it work, as mentioned in https://shiki.style/guide/install#cloudflare-workers
Is there a demo project?
I've just tried on a fresh worker locally and it doesn't work, and am unable to push since it doesn't run - important to note that it doesn't have anything to do with hono
Uncaught TypeError: Cannot read properties of undefined (reading 'buffer')
at null.<anonymous>
(file:///home/ghost/Desktop/ooglaslda/node_modules/.pnpm/@[email protected]/node_modules/@shikijs/core/dist/index.mjs:4657:47)
in u
[code: 10021]
@elliotberry we're not rude like that about other people's work here
@orta read through the lens of objective criticism, that does not come across as rude. perhaps it's too direct for your liking.
@elliotberry we're not rude like that about other people's work here
I apologize for my rudeness, I've deleted my comment
@orta @antfu if we're not allowed to post polite, dissenting replies on this project, please update the code of conduct accordingly. I've previously contributed to shijiki and been a champion of its adoption and success and would like to continue doing so, but only in good faith that the project welcomes constructive dialogue.
@shellscape I don't think it's "not allowed" - but more like they are not related to the issue. Different people have different interoperation of the language, they might sound harsh to someone while it's ok to the others. You are free to describe how you feel, and so could Orta. In any cases, I hope we can have a consensus that those discussions are off-topic and it's already been resolved as the original comment is deleted - so problem solved I suppose. If it ever makes you feel better, I have marked all those discussions as Resolved. I am still up for discussion about this, but not here, we could find another place.