functionland / fula-archived

Client-server stack for Web3! Turn your Raspberry Pi to a BAS server in minutes and enjoy the freedom of decentralized Web with a superior user experience!
https://fx.land
MIT License
4 stars 0 forks source link

can not include latest fula-client from npm for browser #147

Closed gitaaron closed 2 years ago

gitaaron commented 2 years ago

Steps to reproduce

  1. Create a basic webapp using a build tool (eg/ webpack, parcel).
  2. Include the functionland/fula library. For example, try making the following change to examples/doc-sync/fuludocs/package.json -
    -    "@functionland/fula": "../../../libraries/fula-client/src",
    +    "@functionland/fula": "~0.6.0",
  3. Try to run the webapp
    
    > npm install &&  npm start
    Server running at http://localhost:1234
    � Build failed.

@parcel/core: Failed to resolve '@functionland/fula' from './src/App.js'

/Users/asurty/POpen/fxland/fula/examples/doc-sync/fuludocs/src/App.js:5:38 4 | import { BrowserRouter as Router, useLocation } from 'react-router-dom';

5 | import { createClient, Status } from "@functionland/fula"; | ^^^^^^^^^^^^^^^^^^^^ 6 | import { ConnInfo } from "./components/ConnInfo"; 7 | import { BoxConfig } from "./components/BoxConfig";

@parcel/resolver-default: Could not load './dist/index.js' from module '@functionland/fula' found in package.json#browser

/Users/asurty/POpen/fxland/fula/examples/doc-sync/fuludocs/node_modules/@functionland/fula/package.json:9:13 8 | "types": "dist/types/src/index.d.ts",

9 | "browser": "dist/index.js", | ^^^^^^^^^^^^^^^ './dist/index.js' does not exist, did you mean './dist/web/index.js'?' 10 | "scripts": { 11 | "build": "node scripts/build.js && tsc",

I believe the following change to libraries/fula-client/package.json would fix this (besides publishing a new version to npm) -

- "browser": "dist/index.js",·

+ "browser": "dist/web/index.js"