why do i get this when i start the server?
• 04:46:06 ERROR » update assets/script.js:
Cannot overwrite generated asset ‘assets/script.js’.
and this file isnt working / rendering, tho when i upload it directly to my shopify store, it works
Issue: On starting the local dev server, an error appears: “Cannot overwrite generated asset ‘assets/script.js’”, and the JS file doesn’t render locally. Uploading the same file directly to Shopify works.
Context: Custom theme; Shopify CLI (command-line interface) v3.50.2. The issue does not reproduce with Dawn (Shopify’s reference theme) initialized via shopify theme init, pointing to a theme-specific problem rather than a CLI bug.
Troubleshooting steps discussed:
Outcome: Following the delete-in-Admin → pull theme → re-add JS locally sequence fixed the problem. The JS file now works as expected.
Status: Resolved. Likely cause was a generated/locked asset state in the theme that blocked local overwrites; no further action needed.
why do i get this when i start the server?
• 04:46:06 ERROR » update assets/script.js:
Cannot overwrite generated asset ‘assets/script.js’.
and this file isnt working / rendering, tho when i upload it directly to my shopify store, it works
Hi MohammadAL,
A few questions to help me troubleshoot this for you:
shopify theme init are you experiencing the same error - if so it might be related to how the CLI is configured.1- Yes
2- Yes, if I do that the JS file works
3- Yes, custom Theme
4- No, works perfectly
5- 3.50.2
Okay so it sounds like this is theme related rather than CLI related - it’s possible that there’s a change being made to the JS file that is not being accepted when you try to generate the theme. If you just make a simple change like a console.log is the error still appearing?
actually it got fixed, i did what u said, deleted it from admin, downloaded the theme then added the js file locally, and it worked, Thanks for your help ![]()