SOLVED - frontend not communicating with Mokoto backend

I found the solution on discord. I finally was able to get this to work.

  • Built a new project selecting Motoko and Vanilla JS as the “dfx new” options.

  • created my project (i used the tutorial)

  • built and deployed like normal (but this is broken like described above.)

  • added this 2 lines of code to the index.html file above the last 2 lines ( and ) and saved …

  • moved both index.js and index.html to the same directory level as the assets folder, not in the assets folder but the same level. (I used poll as the project name)
    \wsl.localhost\Ubuntu\home\myuser\ic-projects\poll\src\poll_frontend

  • Rebuilt and redeployed. This time it worked!!!

The link to the discord is here Discord link to this fix

1 Like