question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when accessing Localhost:3000

See original GitHub issue

Error when accessing localhost for development, Saying no Context provider. This is a fresh download and instance of VS and the Boilerplate being ran on the local host.

Last issue gave a Compile error and missing Dependencies error: https://github.com/ethereum-boilerplate/ethereum-boilerplate/issues/24


NoMoralisContextProviderError1


Below is what I copied from the Photo _

NoMoralisContextProviderError: Make sure to only call useMoralis within a <MoralisProvider> NoMoralisContextProviderError.ReactMoralisError [as constructor] C:/Users/Owner/Desktop/src/Errors.ts:4 1 | export class ReactMoralisError extends Error { 2 | static isReactMoraliserrpr = true; 3 | 4 | constructor(message: string) { 5 | super([react-moralis]: ${message}); 6 | this.name = “ReactMoralisError”; 7 | this.message = message; View compiled new NoMoralisContextProviderError C:/Users/Owner/Desktop/src/Errors.ts:12 9 | } 10 | 11 | export class NoMoralisContextProviderError extends ReactMoralisError { 12 | constructor(message: string) { 13 | super(message); 14 | this.name = “NoMoralisContextProviderError”; 15 | } View compiled useMoralis C:/Users/Owner/Desktop/src/hooks/useMoralis/useMoralis.ts:9 6 | const moralisContext = useContext(MoralisContext); 7 | 8 | if (!moralisContext) { 9 | throw new NoMoralisContextProviderError( | ^ 10 | “Make sure to only call useMoralis within a <MoralisProvider>”, 11 | ); 12 | } View compiled QuickStart C:/Users/Owner/Desktop/ethereum-boilerplate-main/src/components/QuickStart.jsx:26 23 | }; 24 | 25 | export default function QuickStart({ isServerInfo }) { 26 | const { Moralis } = useMoralis(); 27 | 28 | const isInchDex = useMemo( 29 | () => (Moralis.Plugins?.oneInch ? true : false), View compiled ▶ 17 stack frames were collapsed. Module.<anonymous> C:/Users/Owner/Desktop/ethereum-boilerplate-main/src/index.js:32 29 | }; 30 | 31 | /** Get your free Moralis Account https://moralis.io/ */ 32 | ReactDOM.render( 33 | // <React.StrictMode> 34 | <Application />, 35 | // </React.StrictMode>, View compiled Module…/src/index.js http://localhost:3000/static/js/main.chunk.js:8158:30 webpack_require C:/Users/Owner/Desktop/ethereum-boilerplate-main/webpack/bootstrap:851 848 | 849 | webpack_require.$Refresh$.init(); 850 | try { 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 852 | } finally { 853 | webpack_require.$Refresh$.cleanup(moduleId); 854 | } View compiled fn C:/Users/Owner/Desktop/ethereum-boilerplate-main/webpack/bootstrap:150 147 | ); 148 | hotCurrentParents = []; 149 | } 150 | return webpack_require(request); | ^ 151 | }; 152 | var ObjectFactory = function ObjectFactory(name) { 153 | return { View compiled 1 http://localhost:3000/static/js/main.chunk.js:8536:18 webpack_require C:/Users/Owner/Desktop/ethereum-boilerplate-main/webpack/bootstrap:851 848 | 849 | webpack_require.$Refresh$.init(); 850 | try { 851 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ^ 852 | } finally { 853 | webpack_require.$Refresh$.cleanup(moduleId); 854 | } View compiled checkDeferredModules C:/Users/Owner/Desktop/ethereum-boilerplate-main/webpack/bootstrap:45 42 | } 43 | if(fulfilled) { 44 | deferredModules.splice(i–, 1); 45 | result = webpack_require(webpack_require.s = deferredModule[0]); | ^ 46 | } 47 | } 48 | View compiled Array.webpackJsonpCallback [as push] C:/Users/Owner/Desktop/ethereum-boilerplate-main/webpack/bootstrap:32 29 | deferredModules.push.apply(deferredModules, executeModules || []); 30 | 31 | // run deferred modules when all chunks ready 32 | return checkDeferredModules(); | ^ 33 | }; 34 | function checkDeferredModules() { 35 | var result; View compiled (anonymous function) http://localhost:3000/static/js/main.chunk.js:1:93


Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
KomengTechcommented, Dec 3, 2021

Found a way to solve it. Just needed to install Live Server extension on Visual Studio Code.

0reactions
MashmallowWoRcommented, Jul 17, 2022

i still have the same issue even after restart computer and installed Live Server extension. anything else i should check?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Localhost Refused to Connect Error: 5 Confirmed Ways to Fix It
Localhost refused to connect error can be caused by an incorrectly configured port, insufficient permissions, or an inoperative web server.
Read more >
Localhost Refused to Connect - How to Fix the Error
When developing locally the localhost refused to connect is the worst error you can get. See the causes and what solves the error....
Read more >
localhost:3000 is not working in the browser - Stack Overflow
I have changed browsers and still the same problem is appearing. On the browser it says Unable to connect Firefox can't establish a...
Read more >
How to Fix Localhost Refused to Connect - YouTube
Learn how to fix the localhost refused to connect error with four simple methods. Start your online journey now with Hostinger web hosting ......
Read more >
How to access localhost: 3000 - Quora
To access it, open your web browser and type "localhost:3000" into the address bar. This will take you to the home page of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found