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

In React, Uncaught Error: Cannot find module 'interface-datastore/key' #105

Closed
jwoo9928 opened this issue Nov 27, 2023 · 0 comments
Closed

Comments

@jwoo9928
Copy link

In React, Uncaught Error: Cannot find module 'interface-datastore/key'

Package.json

{
  "name": "testapp",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@orbitdb/core": "^1.0.1",
    "@testing-library/jest-dom": "^5.17.0",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/interface-datastore": "^3.0.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.18.65",
    "@types/react": "^18.2.38",
    "@types/react-dom": "^18.2.17",
    "helia": "^2.1.0",
    "it-drain": "^3.0.5",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.9.5",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "packageManager": "yarn@4.0.2",
  "devDependencies": {
    "@types/events": "^3"
  }
}

App.tsx

import React, { useEffect } from "react";
// import logo from './logo.svg';
import "./App.css";
import { createHelia } from "helia";
import { createOrbitDB } from "@orbitdb/core";

function App() {
  useEffect(() => {
    (async function () {
      const ipfs = await createHelia();
      const orbitdb = await createOrbitDB({ ipfs });
      const db = await orbitdb.open("hello");
      const address = db.address;
      console.log("address", address);
    })();
  }, []);
  
  return (
    <div className="App">
      <header className="App-header">
        {/* <img src={logo} className="App-logo" alt="logo" /> */}
        <p>
          Edit <code>src/App.tsx</code> and save to reload.
        </p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;

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