1

Edit

So after removing the pub/static folder and also removing the .htaccess file with it and breaking my site I'm finally back to where I was.

Still having issues with JS files that don't exist but were included with requirejs-config.js.

enter image description here

I've tried several solutions yet nothing is working. The way I added the custom JS files was by creating a requirejs-config.js file in my theme folder, and then mapping the paths to the files inside. I then included them in the default_head_blocks.xml file. But now that I've deleted the JS files, and removed the requirejs-config.js file, and also removed them from the default_head_blocks.xml file I get these errors in the screenshot above.

3
  • Have you removed them from requireconfig-js? Commented Oct 22, 2018 at 17:20
  • 1
    if you removed the files from requireconfig-js you have to clear the pub/static dir and either setup:di:compile if production more or just refresh page if developer mode Commented Oct 22, 2018 at 17:51
  • I cleared out the pub/static directory, but now my site is broken. I've tried static-content:deploy, setup:di:compile, flushing the cache and reindexing. Nothings working... Commented Oct 23, 2018 at 9:08

1 Answer 1

1

Magento merges all the requirejs-config.js from all the enabled modules into a single requirejs-config.js and places it in pub/static/area/vendor/theme/locale ex: pub/static/frontend/Magento/luma/en_US
You have to remove the entry from this file.
If you are in developer mode just delete this file and Magento will recreate it on page refresh.
If you are in production mode run bin/magento setup:static-content:deploy
You can run this command for your particular theme, area and locale as follows

bin/magento setup:static-content:deploy --language en_US --theme Magento/luma --area frontend 

More on above command : https://devdocs.magento.com/guides/v2.2/config-guide/cli/config-cli-subcommands-static-view.html

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.