BitGo Requires Additional Modules - NextJS
See original GitHub issueWhen I use BitGo in NextJS projects I get an error that requires me to install multiple dependencies. I tried installing each dependency individually but when I got to fs it kept asking me to install the same fs dependency.
Below is the error produced:
error - ./node_modules/@grpc/grpc-js/build/src/tls-helpers.js:20:0
Module not found: Can't resolve 'fs'
Import trace for requested module:
./node_modules/@grpc/grpc-js/build/src/channel-credentials.js
./node_modules/@grpc/grpc-js/build/src/index.js
./node_modules/@hashgraph/sdk/lib/channel/NodeChannel.cjs
./node_modules/@hashgraph/sdk/lib/client/NodeClient.cjs
./node_modules/@hashgraph/sdk/lib/index.cjs
./node_modules/@bitgo/account-lib/dist/src/coin/hbar/utils.js
./node_modules/@bitgo/account-lib/dist/src/utils/crypto.js
./node_modules/@bitgo/account-lib/dist/src/coin/sol/utils.js
./node_modules/@bitgo/account-lib/dist/src/coin/sol/index.js
./node_modules/bitgo/dist/src/v2/coins/sol.js
./node_modules/bitgo/dist/src/v2/coins/index.js
./node_modules/bitgo/dist/src/v2/coinFactory.js
./node_modules/bitgo/dist/src/index.js
./pages/profile.js
Environment Details
- OS: Mac Intel 11.5.1
- Node Version: v16.15.0
- Yarn Version: v1.22.17
- BitGoJS Version: ^14.1.0
- BitGo Environment: N/A
Expected Behavior
NextJS project should build successfully
Current Behavior
The project should build successful and all the dependencies should come in when I add in BitGo into my package.json file.
Possible Solution
I am stuck
Steps to Reproduce
- Create a NextJS project
npx create-next-app testapp
- Install BitGo to the project
yarn install bitgo
- Open up the index.js file and add the following lines above Home
const BitGo = require('bitgo');
const bitgo = new BitGo.BitGo({accessToken: b9.................81af4256797}); // defaults to testnet. add env: 'prod' if you want to go against mainnet
const result = await bitgo.session();
console.dir(result);
export default async function Home() {
return (
....
Issue Analytics
- State:
- Created a year ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Build a MDX-powered blog with Contentlayer and Next
In this article, we'll learn how to use Next.js and Contentlayer to create a static MDX blogging site in this tutorial.
Read more >@bitgo/unspents: Documentation | Openbase
The class unspents.Dimensions provides a class that helps work with the components required to calculate an accurate estimate of a transaction vSize. Examples....
Read more >Supported Browsers and Features - Next.js
Supported Browsers and Features. Next.js supports modern browsers with zero configuration. Chrome 64+; Edge 79+; Firefox 67+; Opera 51+; Safari 12+ ...
Read more >Add an option to output the version that would be published
The problem is that I need to put the version of my project into the built application (via Webpack's DefinePlugin), but the version...
Read more >Web3 Firmware Engineer $56k - $150k in Palo Alto at BitGo
Responsibilities: Develop and modify code to be deployed to Hardware Security Modules (HSM) in C environment; Support ongoing blockchain feature development by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You should be able to refer to this folder for all the webpack configuration options.
This issue was closed because it has been stalled for 5 days with no activity.