Lesson 10. Make a Winner Picked notification #6020
Unanswered
NickoMenty
asked this question in
Q&A
Replies: 1 comment 8 replies
-
The error "ReferenceError: window is not defined" typically occurs when you're trying to access the window object in a Node.js environment. The window object is part of the browser's JavaScript API and is not available in Node.js. If you're trying to connect to an Ethereum provider like MetaMask, this code needs to be run in a browser environment, not in a Node.js environment. MetaMask injects the Ethereum provider into the window object of the browser, which is why you're trying to access window.ethereum. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to make a notification once winner is picked and updateUI.
to do so I eddited onClick button like this:
And added notification:
HOWEVER, to trigger raffle.once I need add Raffle Contract Instance, so I did this:
But I ran into this error, and do not understand why window is undefined

Beta Was this translation helpful? Give feedback.
All reactions