Replies: 7 comments 4 replies
-
|
Hmm... maybe I found it, but I don't know how to proceed: |
Beta Was this translation helpful? Give feedback.
-
|
https://github.com/bufbuild/protobuf-es looks promising... but when I used their example, I got: somehow endo seems to pick the cjs version of their code, even though the supply esm. Their package.json has: "type": "module",
"sideEffects": false,
"main": "./dist/cjs/index.js",
"exports": {
".": {
"module": "./dist/esm/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/proxy/index.js"
}
},my import { User } from './gen/example_pb.js';
export const make = () => {}; |
Beta Was this translation helpful? Give feedback.
-
|
This bit of endo doc looked possibly relevant, but I don't understand it well enough to apply it:
|
Beta Was this translation helpful? Give feedback.
-
|
I agree the patch is valid upstream. Docs here might help
https://nodejs.org/api/packages.html#exports
…On Sat, Dec 2, 2023 at 8:23 PM Dan Connolly ***@***.***> wrote:
I'm inclined to open a protobuf-es issue
<https://github.com/bufbuild/protobuf-es/issues>, but I'm struggling to
find documentation that says that the way their import field goes to CJS
code is not The Right Way.
Clues?
—
Reply to this email directly, view it on GitHub
<#1875 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOXBUG5FTAWIA446BJW4LYHP5FVAVCNFSM6AAAAABADZKWQWVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TONBRHA4DM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I made an analog of Using that, I can import { MsgWalletSpendAction } from 'cosmic-proto-es/swingset/msgs.js';
export const make = () => true;But there's lots of other stubs in So I couldn't confine |
Beta Was this translation helpful? Give feedback.
-
|
You may want to take a look at agoric-labs/protobuf.js where I patched |
Beta Was this translation helpful? Give feedback.
-
|
looks like this is addressed in... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Protobuf is just mangling strings/integers/etc. in memory; it's a perfect candidate for being completely confined. But I'm struggling to get it to work.
I tried to
endo make proto-puzzle.jswhere that file contains:and my
package.jsonhas::The first problem is
SES_EVAL_REJECTED. After some spelunking, I can hack-n-slash around that no problem:Next we find that long is missing from the dependencies in cosmic-proto. hack-slash-hack-slash. There. now it's not missing.
But I'm sorely stumped by the next one:
Cannot read properties of undefined (reading 'dcodeIO').I looked all over the endo logs with
less $(grep -lr 'dcodeIO' ~/.local/state/endo/)but I can't find the line where the error is thrown. Clues, anyone? @kriskowal ?Beta Was this translation helpful? Give feedback.
All reactions