Giter VIP home page Giter VIP logo

Comments (4)

sophiiistika avatar sophiiistika commented on August 12, 2024 1

For working with the unpublished p2panda-js version:

cd p2panda
git pull origin main
cd p2panda-js
npm install
npm run build
npm link

And in the beep-boop repo:
npm link p2panda-js

In case a wasm error is thrown, copy the ***.module.wasm file from p2panda-js/lib into beep-boop/dist. After that, run in the beep-boop repo:
npx serve dist

from zoo-adventures.

sophiiistika avatar sophiiistika commented on August 12, 2024

Two issues I found that I can’t resolve

  • loading issue:
    p2panda-js requires wasm. that means p2panda-js will try to import it over the network, but the code (e.g. createKeyPair()) can’t or won’t wait for wasm to be imported. For that, keyPair.ts and session.ts from p2panda-js probably can be improved.
  • null pointer error:
    after calling the privateKey() we get this error

Screenshot 2021-10-29 at 14 51 00

from zoo-adventures.

adzialocha avatar adzialocha commented on August 12, 2024

loading issue: p2panda-js requires wasm

To solve the issue with Webpack not importing the .wasm file of p2panda-js we just found a solution (not elegant, but working for now):

  1. Install the CopyWebpackPlugin as a dev dependency

  2. Add the following config under plugins in the webpack file (CopyPlugin needs to be imported first):

    new CopyPlugin({
      patterns: [
        { from: 'node_modules/p2panda-js/lib/*.wasm', to: '[name][ext]' },
      ],
    }),
  3. Restart the npm run serve task. Webpack will now copy the needed .wasm file into the dist folder.

I'm making a ticket about this issue, we should evaluate if this is a fine solution for people using Webpack as a bundler or if we need to rewrite our bundling strategy in p2panda-js 😢 p2panda/p2panda#126

from zoo-adventures.

adzialocha avatar adzialocha commented on August 12, 2024

null pointer error: after calling the privateKey() we get this error

This might be related to this invalid syntax here: https://github.com/p2panda/beep-boop/blob/Integrate-new-p2panda-js-0.2.0-API/src/App.tsx#L50 : createKeyPair is a Promise and not a Class so the new keyword does not make sense here. Maybe this resolves the issue? 👍

from zoo-adventures.

Related Issues (19)

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.