magesuite / magepack

Next generation Magento 2 advanced JavaScript bundler.
Open Software License 3.0
437 stars 91 forks source link

ERROR No locales found! Make sure magepack is running after static content is deployed. #57

Open WinstonN opened 4 years ago

WinstonN commented 4 years ago

Hi

On magento default 2.3.5-p2 I'm getting this error when I run magepack bundle

I have the patch installed

"extra": {
        "magento-force": "override",
        "patches": {
            "magento/magento2-base": {
                "Refactor JavaScript mixins module https://github.com/magento/magento2/pull/25587": "patches/composer/M234/github-pr-25587-base.diff"
            }
        }
    }

I do have the MagePack Magento 2 Module installed and bin/magento config:set dev/js/enable_magepack_js_bundling 1

I run bin/magento setup:static-content:deploy -f but still get the error

Can you spot what I am doing wrong?

imino123 commented 4 years ago

try in this order:

1) disable bundling: php bin/magento config:set dev/js/enable_magepack_js_bundling 0

2) clean and flush cache: php bin/magento cache:clean php bin/magento cache:flush

3) Go to the /pub/static directory and remove all the contents within that directory:

cd /pub/static> rm -rf * be very careful when using this command!

(rather than using the * wildcard with the rm command, it is safer to name all the directories and files you intend to remove in the /pub/static directory:

e.g rm -rf adminhtml frontend

4) go back to the directory and run the deploy command and include any language locales you may need: php bin/magento setup:static-content:deploy en_US -f

5) run the bundle command: magepack bundle

6) reenable magesuit bundling: php bin/magento config:set dev/js/enable_magepack_js_bundling 1

7) flush the cache:

php bin/magento cache:flush

Now open firefox or chrome browser and use the developer tools to inspect if js file are bundled.

cuong-tran-solteq commented 4 years ago

What error do you have? it is hard to investigate without that. ah damn, it is in the title, silly me. in that case, you may need to regenerate the static content one again, have you try that in local or in the cloud? this article help me last time https://blog.gaiterjones.com/magento-2-javascript-bundling-with-magepack/

nabeelfocus commented 9 months ago

how to deploy on cloud hooks:

We run build hooks before your application has been packaged.

build: | set -e composer install unset NPM_CONFIG_PREFIX curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" nvm install --lts=erbium

Install Gulp CLI and magepack globally in one command

npm install -g gulp-cli

# Run npm commands in the specific design folder
(cd ./app/design/frontend/Fluid/blank/ &&  npm install && gulp)

# Install magepack globally in one command
  npm install magepack -g
  php ./vendor/bin/ece-tools build:generate
  magepack bundle
  php ./vendor/bin/ece-tools build:transfer

We run deploy hook after your application has been deployed and started.

deploy: | php ./vendor/bin/ece-tools run scenario/deploy.xml

We run post deploy hook to clean and warm the cache. Available with ECE-Tools 2002.0.10.

post_deploy: | php ./vendor/bin/ece-tools run scenario/post-deploy.xml

How to Fix this error ℹ Using bundling config from "/app/magepack.config.js". W: W: ERROR No locales found! Make sure magepack is running after static content is deployed.