Giter Club home page Giter Club logo

Comments (8)

codebycarson avatar codebycarson commented on June 26, 2024 1

@ellemedit can you try bumping your @sei-js/proto to version 4+?

from sei-js.

ellemedit avatar ellemedit commented on June 26, 2024

@ellemedit can you try bumping your @sei-js/proto to version 4+?

I don't use @sei-js/proto directly, it's dependency of @sei-js/cosmjs. So I can try with custom resolutions.

And it looks like it works. Thank you. (Oops, I didn't check correctly)

Update:

I tried with @sei-js/proto@internal-vm and checked package.json:

  "exports": {
    ".": {
      "import": "./dist/esm/codegen/index.js",
      "require": "./dist/cjs/codegen/index.js",
      "types": "./dist/types/codegen/index.d.ts"
    },
    "./types/*": "./dist/types/codegen/*"
  }
Screenshot 2024-04-05 at 13 45 57

But it just a type definition file which is not needed for pure commonjs/esm itself. I think require means a commonjs/esm module not type defs. But there isn't a thing or module for the required path.

I attached import trace for more clues:


../../node_modules/@sei-js/cosmjs/dist/esm/utils/serialize.js:9:10
Module not found: Can't resolve '@sei-js/proto/types/cosmos/tx/v1beta1/tx'
Import trace for requested module:
../../node_modules/@sei-js/cosmjs/dist/esm/utils/index.js
../../node_modules/@sei-js/cosmjs/dist/esm/index.js

from sei-js.

ellemedit avatar ellemedit commented on June 26, 2024

@codebycarson could you check it?

from sei-js.

seangeng avatar seangeng commented on June 26, 2024

@ellemedit looks like I had the same issue - did you manage to resolve it?

from sei-js.

ellemedit avatar ellemedit commented on June 26, 2024

@besated @codebycarson // it wasn't fixed.

In latest @sei-js/[email protected] not able to import package too like:

Failed to compile.
../../node_modules/@sei-js/cosmjs/dist/esm/utils/serialize.js:2:0
Module not found: Package path ./dist/types/codegen/cosmos/tx/v1beta1/tx is not exported from package /home/runner/work/wallet-workspace/wallet-workspace/node_modules/@sei-js/proto (see exports field in /home/runner/work/wallet-workspace/wallet-workspace/node_modules/@sei-js/proto/package.json)

from sei-js.

ellemedit avatar ellemedit commented on June 26, 2024

@ellemedit looks like I had the same issue - did you manage to resolve it?

yes, current workaround script something like:

var fs = require("fs");
var path = require("path");

var targetFiles = [
  "./node_modules/@sei-js/cosmjs/dist/cjs/utils/serialize.js",
  "./node_modules/@sei-js/cosmjs/dist/esm/utils/serialize.js",
];

const asIs = "require('@sei-js/proto/types/cosmos/tx/v1beta1/tx')";
const toBe = "require('cosmjs-types/cosmos/tx/v1beta1/tx');";
targetFiles.forEach((file) => {
  const filePath = path.join(__dirname, "YOUR PATH", file);
  console.log("patch file path", filePath);
  const fileContents = fs.readFileSync(filePath, {
    encoding: "utf-8",
  });
  var result = fileContents.replace(asIs, toBe);
  fs.writeFileSync(filePath, result);
});

with postinstall hook. @seangeng

from sei-js.

codebycarson avatar codebycarson commented on June 26, 2024

Hey @ellemedit @seangeng , this is fixed in version 1.0.5 onwards.

Turns out that serialize function was importing "SignDoc" from @sei-js/proto, however it was importing the typescript type instead of the actual class itself. This has been resolved in the latest version of @sei-js/cosmjs.

Apologies for the issues here.

from sei-js.

ellemedit avatar ellemedit commented on June 26, 2024

@codebycarson thank you for supporting! I see my CI/CD building properly.

from sei-js.

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.