cancel
Showing results for 
Search instead for 
Did you mean: 

Uncaught Type Error in magento 2 and 404 error

Uncaught Type Error in magento 2 and 404 error

So I've installed Magento 2 onto a WAMP server however the main UI looks very odd and the console error log is showing: 

 

"Uncaught TypeError: require is not a function" and "GET http://localhost/Magento2/pub/static/version1533909984/adminhtml/Magento/backend/en_US/requirejs-config.js 404 (Not Found)" .

 

As you can see from the screenshot, I've attempted to run several commands such as:

1.) php bin/magento dev:source-theme:deploy

2.) php bin/magento deploy:mode:set production

magento2 -error.png

Thanks in advance Smiley Happy 

cmd.png

4 REPLIES 4

Re: Uncaught Type Error in magento 2 and 404 error

Hi @greg_taylor

 

Well I have seen the command you have run so far , but you actually need to run deploy command as your assets and js are not showing properly !

 

Revert back to your magento application in developer Mode first and then Run below commands in sequence :

 

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:clean
php bin/magento cache:flush

Hope it helps !

 

if issue solved,Click Kudos & Accept as Solution

Re: Uncaught Type Error in magento 2 and 404 error

Kindly give Magento permission for your site instance using below way,

sudo find var pub/static pub/media -type f -exec chmod g+w {} \; 
sudo find var pub/static pub/media -type d -exec chmod g+ws {} \;
sudo find ./pub/media -type d -exec chmod 777 {} \;
sudo find ./pub/static -type d -exec chmod 777 {} \;

Run command,

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush
If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

Re: Uncaught Type Error in magento 2 and 404 error

Hello @greg_taylor ,

 

Please run below command in Magento root directory

Below command for Magento files and directory permissions

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml;

Below command deploy static content, compile code, indexing content and clear cache

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento cache:flush

If you still get an issue then let us know.

 

--
If you've found one of my answers useful, please give "Kudos" or "Accept as Solution"

Re: Uncaught Type Error in magento 2 and 404 error

Hello I have the same Error. when I use multi store configuration. 

 

GET https://newleobien.supertics.com/padres/tienda/static/version1625568755/frontend/Supertics/base/es_E... net::ERR_ABORTED 404

 

its the same if I use luma theme. I tried do all suggestions and nothing

 

the file exist unto the path frontend/Supertics/base/es_ES/requirejs-config.js in static pub folder

 

Please can you help me 

 

Thanks