product id is required

Returned error: project ID is required
Error: Returned error: project ID is required
at Object.ErrorResponse (/home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/web3-core-helpers/src/errors.js:29:16)
at /home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/web3-core-requestmanager/src/index.js:170:36
at XMLHttpRequest.request.onreadystatechange (/home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/web3-providers-http/src/index.js:111:13)
at XMLHttpRequestEventTarget.dispatchEvent (/home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/xhr2-cookies/xml-http-request-event-target.ts:44:13)
at XMLHttpRequest._setReadyState (/home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/xhr2-cookies/xml-http-request.ts:219:8)
at XMLHttpRequest._onHttpResponseEnd (/home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/xhr2-cookies/xml-http-request.ts:345:8)
at IncomingMessage. (/home/saurabh/Documents/Block-chain/projects/CrowdCoin/node_modules/xhr2-cookies/xml-http-request.ts:311:39)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

Hi @Saurabh_Kumar, welcome to our community! Can you share your code with us so we can better analyze what you’re trying to do when you get this error message? It looks like you’re missing a product ID - our docs may be able to help you get set up.

Hi @Leiya_Kenney

import React, { Component } from “react”;
import { Card, Button } from “semantic-ui-react”;
import factory from “…/ethereum/factory”;
import Layout from “…/components/Layout”;
import { Link } from “…/routes”;

class CampaignIndex extends Component {
static async getInitialProps() {
console.log(“Hello”);
const campaigns = await factory.methods.getDeployedCampaigns().call();
console.log(“Helo”);
return { campaigns };
}

renderCampaigns() {
const items = this.props.campaigns.map(address => {
return {
header: address,
description: (
<Link route={/campaigns/${address}}>
View Campaign

),
fluid: true
};
});

return <Card.Group items={items} />;

}

render() {
return (


Open Campaigns

      <Link route="/campaigns/new">
        <a>
          <Button
            floated="right"
            content="Create Campaign"
            icon="add circle"
            primary
          />
        </a>
      </Link>

      {this.renderCampaigns()}
    </div>
  </Layout>
);

}
}

export default CampaignIndex;

As i found whenever i’m making a call to contract it shows " project id is required"
Surprisingly the problem fixes when i make changes( like changing console.log output) and save the file afterwards. But i can’t do that on all of my pages,
This is the configuration i’m using :

{
“name”: “kickstart”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
“test”: “mocha”,
“dev”: “node server.js”,
“build”: “next build”
},
“author”: “”,
“license”: “ISC”,
“dependencies”: {
“fs-extra”: “^5.0.0”,
“ganache-cli”: “^6.0.3”,
“mocha”: “^4.1.0”,
“next”: “^4.1.4”,
“next-routes”: “^1.2.0”,
“react”: “^16.2.0”,
“react-dom”: “^16.2.0”,
“semantic-ui-css”: “^2.2.12”,
“semantic-ui-react”: “^0.77.1”,
“solc”: “^0.4.19”,
“truffle-hdwallet-provider”: “0.0.3”,
“web3”: “1.0.0-beta.26”
}
}

Thanks for providing that for us! We’re looking into it and will let you know what we find.

Hi @Saurabh_Kumar can you share the code where you are setting your Infura API credentials?