Question

Hello!

I have Magento version 2.3.3.

I run:

bin/magento setup:upgrade

bin/magento setup:di:compile

bin/magento bin/magento setup:static-content:deploy -f

And permissions for folders:

But after commands in pub/static/frontend folder i not find module with my styles and with my JS code.

How i can fix it?

Please, help me)

Was it helpful?

Solution 2

I resolved problem!

My folder that I searched in the folder pub/static located in app/design and Magento 2.3.3 will not use this code unless it is a module.

Therefore, I need to transfer my code to app/code/[Alias].

Hope this information helps someone.

OTHER TIPS

1. Put your Custom JS file in the following directory

app/code/Vendor/YourModuleName/view/frontend/web/js/your_js_file_name.js

-> And your require-config.js file is in directory

var config = {
        map: {
            '*': {
                myjs: 'Vendor_YourModuleName/js/your_js_file_name'
            }
        }
    };

2. Delete Generated Files, Sessions & Caches:

YOUR_MAGENTO2_ROOT/var/cache/ ****DELETE ALL****

YOUR_MAGENTO2_ROOT/var/page_cache/ ****DELETE ALL****

YOUR_MAGENTO2_ROOT/var/session/ ****DELETE ALL****

YOUR_MAGENTO2_ROOT/var/view_preprocessed/ ****DELETE ALL****

-> Also, remove everything including old generated static files from below path except .htaccess:

YOUR_MAGENTO2_ROOT/pub/static/ ****DELETE ALL**** EXCEPT .HTACCESS

YOUR_MAGENTO2_ROOT/generated/code/ ****DELETE ALL****

YOUR_MAGENTO2_ROOT/generated/metadata/ ****DELETE ALL****

3. Open terminal and run following commands:

php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
chmod -R 777 var/ pub/ generated/
chmod -R 777 var/* pub/* generated/*

Now check your modules js files are loaded under pub/static/

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top