Samsung / Wits

Wits for Your Tizen web application development.It will saved your development times and bring pleasure of developing out. Using Wits, You can instantly RELOAD your app's JavaScript/CSS code instead of reinstalling your app every time you make a change.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getting 'Failed to load resource' when running an application build.

Guidogl opened this issue · comments

commented

Hi, I am experimenting with Wits and when I try to run an application build from WWW directory, I get Failed to load resource: net::ERR_FILE_NOT_FOUND error. I tried to change src link from src="/static/..." to src="./static/..." and then it works fine but it is very inconveniente to always change my application build manually. You should build Wits, so it would read same directory files without ./ o rperaphs there is already a way to overcome this?

Hi.
Are you saying that you load the resource file which is located in WWW/static folder?
So setting the src path is HTML5 spec. not WITs spec.
If you load it like that in the chrome browser, it will fail.

If I do not understand well, please explain it in more detail.
thank you.

commented

Hi,
Yes, I am loading resources from STATIC folder as it is default folder of React production build. I place all the files in WWW folder as it is recommended, so resources are loaded from www/static folder.

By default React creates src path like this - /static/... and with that path, I get Failed to load resource: net::ERR_FILE_NOT_FOUND error. If I try to load same build to Tizen Studio, it works without errors, just takes a long time to load. Then, I tried to change src path to ./static/... and it worked but I wouldn't like to always change paths of production build.

This problem persists even when I load files with the full URL, so it seems that supported src paths are ./example and example/ that points to a file in the same directory.

commented

Hi.
Are you saying that you load the resource file which is located in WWW/static folder?
So setting the src path is HTML5 spec. not WITs spec.
If you load it like that in the chrome browser, it will fail.

If I do not understand well, please explain it in more detail.
thank you.

Sorry for taking your time. Just found out that it is a React thing and I changed paths there. Now closing this issue.