Skip to content

Commit

Permalink
Fixed build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
shamin committed Sep 2, 2021
1 parent 232fb9f commit 116c9d3
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 14 deletions.
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"start": "npm run dev",
"build": "tsc && vite build",
"serve": "vite preview",
"create-mint": "node scripts/createMint.js"
"create-mint": "node scripts/createMint.js",
"deploy": "npx surge dist share-ride.surge.sh"
},
"dependencies": {
"@project-serum/anchor": "^0.13.2",
Expand Down
2 changes: 0 additions & 2 deletions client/src/app/pages/offer/offer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const Offer = () => {
const {
addDriver,
loadDrivers,
loading,
showCompleteModal,
setShowCompleteModal,
} = shareRideState;
Expand Down Expand Up @@ -176,7 +175,6 @@ export const Offer = () => {
</div>
{
<Button
isLoading={loading}
disabled={
!fromAddress || !toAddress || !selectedSeats || !costPerKm
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/ride/PolyLineOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { PureComponent } from "react";
import React from "react";
import { CanvasOverlay } from "react-map-gl";

const settings = {
Expand Down
21 changes: 14 additions & 7 deletions client/src/app/web3/provider/state/arweave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class ArweaveService {
this.walletKey = this.testWeave?.rootJWK;
});
} else {
this.arweave = Arweave.init({});
this.arweave = Arweave.init({
host: 'arweave.net'
});
this.walletKey = WalletJson;
}
}
Expand All @@ -53,13 +55,18 @@ class ArweaveService {

async getData(drivers: Array<ArweaveDriver>): Promise<Array<unknown>> {
const arweaveData = drivers.map(async ({ archive }) => {
const data = await this.arweave.transactions.getData(archive, {
decode: true,
string: true,
});
return { ...JSON.parse(data?.toString()), archiveId: archive };
try {
const data = await this.arweave.transactions.getData(archive, {
decode: true,
string: true,
});
return { ...JSON.parse(data?.toString()), archiveId: archive };
} catch(err) {
return null
}
});
return Promise.all(arweaveData);
const data = await Promise.all(arweaveData);
return data.filter((d)=>d!==null)
}
}

Expand Down
Empty file.
4 changes: 2 additions & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
Expand All @@ -13,7 +13,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
"jsx": "react",
},
"include": ["./src"]
}
4 changes: 3 additions & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export default defineConfig({
server: {
port: 5000
},
plugins: [reactRefresh(), polyfillNode()],
plugins: [reactRefresh(),
// polyfillNode()
],
optimizeDeps: {
exclude: ["web3"], // <= The libraries that need shimming should be excluded from dependency optimization.
},
Expand Down

0 comments on commit 116c9d3

Please sign in to comment.