My hello Dapp is running but i m not getting image and styles on localhost

how to fix it the js is working but i m not getting style and images in the network tag is shows error 404 probably some configuration error of wsl with ip and localhost configuration any solution here is the screenshot i m using windows 11

Do you get any errors in the browser console? Those could be very helpful to diagnose.

By the way, what version of dfx (and WSL maybe) are you running? We’ve had reports of WSL not working at all with currently shipping replicas.

yes it shows image favicon and stylesheet not found futher when i check the Network tab it is fetching image from: http://localhost:8080/logo.png and failed that’s why i was wondering maybe i need to do something with port forwarding maybe localhost is not accessing data from virtual linux also from an external image url it looks like it it working updating the screenshots for the better understanding.

dfx 0.10.1
Ubuntu version 2



welp… I’m getting the same on my macOS machine. I’ll ask around in the team. This certainly is not a problem with WSL.

To see things properly, you can run dfx deploy instead of npm start. This will not have hot-reloading, so you’ll have to dfx deploy all the time, but it should work. You can then see your app if you go to the URL displayed by dfx deploy.

I tried a few more things. Looks like the problem is in some dependencies. I’m not good enough with webpack/npm to fix it, and even less so on someone else’s machine. But… if you want it working from dfx new, you can build the latest dfx from master. It’s not hard. Just cargo build after cloning GitHub - dfinity/sdk: The DFINITY Canister Software Development Kit (SDK).

1 Like

ok i’ll try to clone and run it again also the latest webpack-cli came with a previous version i follow the steps from the oficial website but in the end npm start wasn’t working i updated the webpack-cli to latest version it starts working to only problem i have is given above i try to get it fixed thanks for your help

not able to proceed anyone from team can help me out why the images and css is not generating
I m using these versions

:~/Projects/hello$ dfx --version
dfx 0.10.1
:~/Projects/hello$ dfx cache list
0.9.3
0.10.1 *
:~/Projects/hello$ npm --version
8.11.0
:~/Projects/hello$ node --version
v16.16.0

    "webpack": "^5.72.0",
    "webpack-cli": "^4.10.0",

here should be my assets(images and css) in dist/hello_assets folder i guess but it seems it is not getting generated by webpack

:~/Projects/hello$ ls -lah dist/hello_assets
total 1.3M
drwxr-xr-x 2 jarralz jarralz 4.0K Jul 14 10:25 .
drwxr-xr-x 3 jarralz jarralz 4.0K Jul 14 10:25 ..
-rw-r--r-- 1 jarralz jarralz  663 Jul 14 10:25 index.html
-rw-r--r-- 1 jarralz jarralz 616K Jul 14 10:25 index.js
-rw-r--r-- 1 jarralz jarralz 665K Jul 14 10:25 index.js.map

The only discrepancy between our configurations is the node version:

❯ node --version 
v18.3.0

If this also doesn’t help, can you try dfx upgrade? A new version just dropped that should have working versions in it again.

i downgrade the dfx version to 0.9.3 and everything start working now i m wondering if i want to use the latest version how can i as previously you see it wasn’t generating images and css here is the screenshot everything is fine now

this breaking change (Dfx 0.11.0 is promoted with breaking changes) sounds like the reason of the issue