bokub / vanity-eth

💎 Browser-based ETH vanity address generator
https://vanity-eth.tk
MIT License
741 stars 264 forks source link

Change code in file src/js/vanity.js does not apply #41

Closed helloairdrop closed 1 year ago

helloairdrop commented 2 years ago

Hi there, I am trying to learn and also test something on this source code But when I try to change code in src/js/vanity.js, the app never reloads and the new code doesn't apply as well

I am not sure why it's happen, I think some config there I doesn't understand Could you help?

Reproduce:

bokub commented 2 years ago

Hello,

Can you please provide an example of what you changed in vanity.js, so I can test with the exact same conditions?

Also, did you see any warning or error in the console where you run yarn serve ?

By the way, this project uses npm, not yarn, so you should maybe delete your node_modules folder and run npm i instead of yarn. Using yarn may download different dependencies because it doesn't use the same lock file as npm.

helloairdrop commented 2 years ago

Hello,

I added some new code like log: console.log('call to vanity js file') under line 6 in vanity.js file or another in onmessage fuction: console.log('onmessage emit')

When I am running withyarn serve there is no error or warning and I tried to run with npm (deleted node_modules ), it never reloads and applys new code on the app as well (same yarn)

Reproduce:

  1. get the source code on github
  2. run npm i
  3. run npm run serve (it's working on port 8080)
  4. change some code in vanity.js file, like console.log('checking the changes') then save (the app doesn't reload and the new code doesn't apply)
  5. try again to change some code

I found some config can help it reload and apply the new code: https://stackoverflow.com/questions/60069459/npm-run-build-without-cache-folder-in-node-modules, we can add this code into file vue.config.js, it will delete cache whenever we change the code

 config.module.rule('vue').uses.delete('cache-loader');
 config.module.rule('js').uses.delete('cache-loader');

Not sure this is the good solution or not, if you have better solution, could you share me? Thank you!!!

image

helloairdrop commented 2 years ago

Thank you for your reply,

I added comment on github already

Could you help to check it?

Vào Th 2, 13 thg 6, 2022 vào lúc 00:01 Boris K @.***> đã viết:

Hello,

Can you please provide an example of what you changed in vanity.js, so I can test with the exact same conditions?

Also, did you see any warning or error in the console where you run yarn serve ?

— Reply to this email directly, view it on GitHub https://github.com/bokub/vanity-eth/issues/41#issuecomment-1153233847, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3FCAFEHZPPKENTB62UMYDVOYJVTANCNFSM5YRDGDYQ . You are receiving this because you authored the thread.Message ID: @.***>

bokub commented 2 years ago

A console.log here would create a log in the browser, not in the terminal.

Are you sure you're looking in the right place ?

bokub commented 2 years ago

OK, there is some issue with the hot-reload mechanism for this file...

After changes to vanity.js, you can do the following to make sure it's re-compiled:

rm -rf node_modules/.cache
npm run serve