Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package path . is not exported from package #1420

Open
willpan1102 opened this issue Apr 28, 2024 · 0 comments
Open

Package path . is not exported from package #1420

willpan1102 opened this issue Apr 28, 2024 · 0 comments

Comments

@willpan1102
Copy link

willpan1102 commented Apr 28, 2024

Hi! I am trying to use web3storage library but I am having problems when I try to run my server

Package path . is not exported from package D:\dev\demo\frontend\node_modules@web3-storage\w3up-client (see exports field in D:\dev\demo\frontend\node_modules@web3-storage\w3up-client\package.json)

I don't know how to fix this issue. This is a new typescript project

Here is my code:

import { create } from '@web3-storage/w3up-client';

export const getWeb3IpfsId = async (params: object | string) => {
  const client = await create();
  // first time setup!
  if (!Object.keys(client.accounts()).length) {
    // waits for you to click the link in your email to verify your identity
    const account = await client.login(web3StorageEmail);
    // create a space for your uploads
    const space = await client.createSpace('power-voting');
    // associate this space with your account
    await account.provision(space.did());
    // save the space to the store, and set as "current"
    await space.save();
  }

  const json = JSON.stringify(params);
  const data = new Blob([json]);
  const cid = await client.uploadFile(data);
  return cid;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant