Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

deepak379's avatar

Js file Not Updating in website.

I updated a javascript file on shared hosting but website is showing previous file.why?

0 likes
13 replies
deepak379's avatar

How to set mix for production? I think this is the real thing disturbing me. Can You Explain?

deepak379's avatar

I tried every cache method is not working for me.

deepak379's avatar

still not getting it.I just did everything whatever it needs to.

drewdan's avatar

Have you built the files using npm run dev or npm run build or the yarn equivalent of you're using yarn

1 like
deepak379's avatar

Sorry, I should explain the problem in brief. I made a different js file in public/js folder named something.js But when I uploaded it on shared hosting my website doesn't reflecting that file. What other file should I change manually. I am still in learning mode don't know much about webpacking.

jlrdw's avatar
jlrdw
Best Answer
Level 75

Just try it without mix. Make sure it works. Try deleting it from server and copy it over again. Make sure you clear all your catche.

1 like
deepak379's avatar

@jlrdw just did What I you said. I removed mix then uploaded whole website again for no-mistake. Also checked it in local 2-3 times. But there is no Change on website. Considering Cache thing.

jlrdw's avatar

The file has to be there if it's uploaded, probably just not loading.

I have a custom assets folder, and call (load) like this:

php templates

<script type="text/javascript" src="<?php echo asset('assets/js/custom.js'); ?>"></script>

blade

<script type="text/javascript" src="{{ asset('assets/js/custom.js' )}"></script>

I have never had trouble with the asset helper.

I clear all config's / cache's prior uploading.

1 like
deepak379's avatar

[solved] Just changed javascript file name and everything is working fine. Thanks for all your kind replies. special thanks to @jlrdw , I tried Everything you said.You are good at your job.

Please or to participate in this conversation.