Merged JS and CSS do not work when Production mode
I was in developer mode, everything was great, when I changed to Production mode, the Merged options of CSS and JS seem to be ignored, it was back listing all css and js.
Also the product page only shows the pictures of the product in developer mode, after changing to production mode they disappear.
Any thought to help me?
The point is, I'm doing it.
Here is what I did in sequence:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento setup:static-content:deploy
bin/magento setup:di:compile
bin/magento deploy:mode:set production
bin/magento setup:static-content:deploy
And before even starting, the Merge options are YES and I was in developer mode.
magento2 javascript css
add a comment |
I was in developer mode, everything was great, when I changed to Production mode, the Merged options of CSS and JS seem to be ignored, it was back listing all css and js.
Also the product page only shows the pictures of the product in developer mode, after changing to production mode they disappear.
Any thought to help me?
The point is, I'm doing it.
Here is what I did in sequence:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento setup:static-content:deploy
bin/magento setup:di:compile
bin/magento deploy:mode:set production
bin/magento setup:static-content:deploy
And before even starting, the Merge options are YES and I was in developer mode.
magento2 javascript css
Hello, Have you got any solution of this issue, I am getting same issue in magento 2.0.7. Please give the solution if you have any, Thanks
– Ashish Jagnani
Oct 3 '16 at 9:36
add a comment |
I was in developer mode, everything was great, when I changed to Production mode, the Merged options of CSS and JS seem to be ignored, it was back listing all css and js.
Also the product page only shows the pictures of the product in developer mode, after changing to production mode they disappear.
Any thought to help me?
The point is, I'm doing it.
Here is what I did in sequence:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento setup:static-content:deploy
bin/magento setup:di:compile
bin/magento deploy:mode:set production
bin/magento setup:static-content:deploy
And before even starting, the Merge options are YES and I was in developer mode.
magento2 javascript css
I was in developer mode, everything was great, when I changed to Production mode, the Merged options of CSS and JS seem to be ignored, it was back listing all css and js.
Also the product page only shows the pictures of the product in developer mode, after changing to production mode they disappear.
Any thought to help me?
The point is, I'm doing it.
Here is what I did in sequence:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento setup:static-content:deploy
bin/magento setup:di:compile
bin/magento deploy:mode:set production
bin/magento setup:static-content:deploy
And before even starting, the Merge options are YES and I was in developer mode.
magento2 javascript css
magento2 javascript css
edited 5 mins ago
guaka
1113
1113
asked Mar 15 '16 at 22:27
BrunoBuenoBrunoBueno
7133926
7133926
Hello, Have you got any solution of this issue, I am getting same issue in magento 2.0.7. Please give the solution if you have any, Thanks
– Ashish Jagnani
Oct 3 '16 at 9:36
add a comment |
Hello, Have you got any solution of this issue, I am getting same issue in magento 2.0.7. Please give the solution if you have any, Thanks
– Ashish Jagnani
Oct 3 '16 at 9:36
Hello, Have you got any solution of this issue, I am getting same issue in magento 2.0.7. Please give the solution if you have any, Thanks
– Ashish Jagnani
Oct 3 '16 at 9:36
Hello, Have you got any solution of this issue, I am getting same issue in magento 2.0.7. Please give the solution if you have any, Thanks
– Ashish Jagnani
Oct 3 '16 at 9:36
add a comment |
10 Answers
10
active
oldest
votes
I just did the following and the problem was solved:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
# Here was the secret: run the di:compile after production
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
2
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
This worked for me.
– dchayka
Jan 10 '17 at 15:55
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
|
show 1 more comment
I have the similar issue. The cause for no image is because there is an error in JS file after minify JS. You can verify it in your browser (firebug etc).
.../div>';return __p};})(window,document,location,typeof
jQuery!=='undefined'&&jQu
I solved this by remove all the file in var/cache/ and pub/static/ and setup:static-content:deploy again
But there is still another issue, it's about the braintree if you enable it. Braintree doesn't show up due to another JS error.
Error: Script error for:
https://js.braintreegateway.com/v2/braintree.js
http://requirejs.org/docs/errors.html#scripterror
...Error(id,msg,err,requireModules){var e=new
Error(msg+'nhttp://requirejs.org/doc...
For now, I simply don't use the minify js function to avoid the trouble until solution is found.
add a comment |
These are the steps that worked for me on Magento ver. 2.1.7 with Redis (not running Varnish). However, it's still unclear if everything is working as it should. JS is minified and bundled (unclear what merge is supposed to do). CSS is minified (not seeing it merged).
- Turn off all Magento cache.
- Clear redis cache.
- Turn all five css/js configs on (either in admin or via database).
- Generate static files.
- Clear Magento cache (command line). For safety (may not be required).
- Clear opcache (if not set to auto refresh).
- Refresh frontend home page (and check browser console for errors).
- Turn on Magento cache.
dev/css/merge_css_files = 1
dev/css/minify_files = 1
dev/js/enable_js_bundling = 1
dev/js/merge_files = 1
dev/js/minify_files = 1
Simply turning on the configs and clearing cache didn't work -- the frontend browser console reported a lot of js errors.
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
add a comment |
Have you tried to flush the JavaScript/CSS? You can do this under System>Cache Management and then press the button which is on the bottom of the table on the left 'Flus JavaScript/CSS Cache'
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
add a comment |
You need to redeploy static after enabling this option in production mode.
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
add a comment |
Make sure you check your NGINX configuration file as well.
If there is a variable $MAGE_MODE set there it needs to be changed to production as well, and save the file
After that you will need to reload or restart NGINX depending on your preference.
sudo service nginx reload
OR
sudo service nginx restart
After that check your app/etc/env.php and see if the MAGE_MODE array key is set to production as well if not change it to production or you can use the command
php bin/magento deploy:mode:set production
After you executed the command check if the value changed app/etc/env.php, sometimes there might be permission issues.
Next, clean out the pub/static folder.
rm -rf pub/static/*
Clear/Flush your cache
php bin/magento cache:clean
php bin/magento cache:flush
Now you are ready to execute the static content deploy
php bin/magento setup:static-content:deploy
Hope this helps.
add a comment |
I just did the following and the problem was solved.
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
(Here was the secret, to run the di:compile after production)
bin/magento setup:static-content:deploy
add a comment |
Please also enable "Enable JavaScript Bundling" option
store->configuration->advanced->developer->javascript setting->
Enable JavaScript Bundling set to "yes" And flush cache
1
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
add a comment |
I've had the problem when the JavaScript is un-compiled the jquery selector works.
$('#my_element').click(function(){ alert('Hello World');});
But once compiled, compressed and joined, I then need to code:-
$('body #my_element').click(function(){ alert('Hello World');});
Don't ask why, it seems that when reading directly from the cache, the requirejs code executes before the domReady and the elements attach to different elements in some different page.
add a comment |
Delete cache manually var/cache and delete session manually var/session
1
Deletingvar/sessionis never an appropiate solution. magento.stackexchange.com/questions/94589/…
– Fabian Schmengler
Sep 14 '16 at 10:42
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f106436%2fmerged-js-and-css-do-not-work-when-production-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
10 Answers
10
active
oldest
votes
10 Answers
10
active
oldest
votes
active
oldest
votes
active
oldest
votes
I just did the following and the problem was solved:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
# Here was the secret: run the di:compile after production
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
2
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
This worked for me.
– dchayka
Jan 10 '17 at 15:55
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
|
show 1 more comment
I just did the following and the problem was solved:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
# Here was the secret: run the di:compile after production
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
2
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
This worked for me.
– dchayka
Jan 10 '17 at 15:55
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
|
show 1 more comment
I just did the following and the problem was solved:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
# Here was the secret: run the di:compile after production
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
I just did the following and the problem was solved:
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
# Here was the secret: run the di:compile after production
bin/magento setup:di:compile
bin/magento setup:static-content:deploy
edited 5 mins ago
guaka
1113
1113
answered Mar 16 '16 at 17:23
BrunoBuenoBrunoBueno
7133926
7133926
2
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
This worked for me.
– dchayka
Jan 10 '17 at 15:55
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
|
show 1 more comment
2
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
This worked for me.
– dchayka
Jan 10 '17 at 15:55
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
2
2
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
i tried same way but no luck
– Pradeep Kumar
May 31 '16 at 8:30
This worked for me.
– dchayka
Jan 10 '17 at 15:55
This worked for me.
– dchayka
Jan 10 '17 at 15:55
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
If i execute command "production -s" it blank my site and give very unusal error: Warning: include(/siteRoot/html/var/view_preprocessed/html/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /siteRoot/html/vendor/magento/framework/View/Result/Page.php on line 312
– Jai
Feb 24 '17 at 9:25
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Another - that worked for me. In case anyone else is having the problem I was. CSS would minify and bundle, but JS would not, despite having the options enabled in the admin. Adding the -s in the set product mode made all the difference. Also, the backend is MUCH faster now as well. I was using the same order and commands, but it was the "-s" that made the difference, Thank you
– dawhoo
Mar 26 '17 at 20:31
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
Do i first need to switch back to development mode? I did what you mentioned, but no difference....
– Jilco Tigchelaar
Jul 24 '17 at 18:22
|
show 1 more comment
I have the similar issue. The cause for no image is because there is an error in JS file after minify JS. You can verify it in your browser (firebug etc).
.../div>';return __p};})(window,document,location,typeof
jQuery!=='undefined'&&jQu
I solved this by remove all the file in var/cache/ and pub/static/ and setup:static-content:deploy again
But there is still another issue, it's about the braintree if you enable it. Braintree doesn't show up due to another JS error.
Error: Script error for:
https://js.braintreegateway.com/v2/braintree.js
http://requirejs.org/docs/errors.html#scripterror
...Error(id,msg,err,requireModules){var e=new
Error(msg+'nhttp://requirejs.org/doc...
For now, I simply don't use the minify js function to avoid the trouble until solution is found.
add a comment |
I have the similar issue. The cause for no image is because there is an error in JS file after minify JS. You can verify it in your browser (firebug etc).
.../div>';return __p};})(window,document,location,typeof
jQuery!=='undefined'&&jQu
I solved this by remove all the file in var/cache/ and pub/static/ and setup:static-content:deploy again
But there is still another issue, it's about the braintree if you enable it. Braintree doesn't show up due to another JS error.
Error: Script error for:
https://js.braintreegateway.com/v2/braintree.js
http://requirejs.org/docs/errors.html#scripterror
...Error(id,msg,err,requireModules){var e=new
Error(msg+'nhttp://requirejs.org/doc...
For now, I simply don't use the minify js function to avoid the trouble until solution is found.
add a comment |
I have the similar issue. The cause for no image is because there is an error in JS file after minify JS. You can verify it in your browser (firebug etc).
.../div>';return __p};})(window,document,location,typeof
jQuery!=='undefined'&&jQu
I solved this by remove all the file in var/cache/ and pub/static/ and setup:static-content:deploy again
But there is still another issue, it's about the braintree if you enable it. Braintree doesn't show up due to another JS error.
Error: Script error for:
https://js.braintreegateway.com/v2/braintree.js
http://requirejs.org/docs/errors.html#scripterror
...Error(id,msg,err,requireModules){var e=new
Error(msg+'nhttp://requirejs.org/doc...
For now, I simply don't use the minify js function to avoid the trouble until solution is found.
I have the similar issue. The cause for no image is because there is an error in JS file after minify JS. You can verify it in your browser (firebug etc).
.../div>';return __p};})(window,document,location,typeof
jQuery!=='undefined'&&jQu
I solved this by remove all the file in var/cache/ and pub/static/ and setup:static-content:deploy again
But there is still another issue, it's about the braintree if you enable it. Braintree doesn't show up due to another JS error.
Error: Script error for:
https://js.braintreegateway.com/v2/braintree.js
http://requirejs.org/docs/errors.html#scripterror
...Error(id,msg,err,requireModules){var e=new
Error(msg+'nhttp://requirejs.org/doc...
For now, I simply don't use the minify js function to avoid the trouble until solution is found.
answered Jun 18 '16 at 8:47
NeroNero
387520
387520
add a comment |
add a comment |
These are the steps that worked for me on Magento ver. 2.1.7 with Redis (not running Varnish). However, it's still unclear if everything is working as it should. JS is minified and bundled (unclear what merge is supposed to do). CSS is minified (not seeing it merged).
- Turn off all Magento cache.
- Clear redis cache.
- Turn all five css/js configs on (either in admin or via database).
- Generate static files.
- Clear Magento cache (command line). For safety (may not be required).
- Clear opcache (if not set to auto refresh).
- Refresh frontend home page (and check browser console for errors).
- Turn on Magento cache.
dev/css/merge_css_files = 1
dev/css/minify_files = 1
dev/js/enable_js_bundling = 1
dev/js/merge_files = 1
dev/js/minify_files = 1
Simply turning on the configs and clearing cache didn't work -- the frontend browser console reported a lot of js errors.
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
add a comment |
These are the steps that worked for me on Magento ver. 2.1.7 with Redis (not running Varnish). However, it's still unclear if everything is working as it should. JS is minified and bundled (unclear what merge is supposed to do). CSS is minified (not seeing it merged).
- Turn off all Magento cache.
- Clear redis cache.
- Turn all five css/js configs on (either in admin or via database).
- Generate static files.
- Clear Magento cache (command line). For safety (may not be required).
- Clear opcache (if not set to auto refresh).
- Refresh frontend home page (and check browser console for errors).
- Turn on Magento cache.
dev/css/merge_css_files = 1
dev/css/minify_files = 1
dev/js/enable_js_bundling = 1
dev/js/merge_files = 1
dev/js/minify_files = 1
Simply turning on the configs and clearing cache didn't work -- the frontend browser console reported a lot of js errors.
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
add a comment |
These are the steps that worked for me on Magento ver. 2.1.7 with Redis (not running Varnish). However, it's still unclear if everything is working as it should. JS is minified and bundled (unclear what merge is supposed to do). CSS is minified (not seeing it merged).
- Turn off all Magento cache.
- Clear redis cache.
- Turn all five css/js configs on (either in admin or via database).
- Generate static files.
- Clear Magento cache (command line). For safety (may not be required).
- Clear opcache (if not set to auto refresh).
- Refresh frontend home page (and check browser console for errors).
- Turn on Magento cache.
dev/css/merge_css_files = 1
dev/css/minify_files = 1
dev/js/enable_js_bundling = 1
dev/js/merge_files = 1
dev/js/minify_files = 1
Simply turning on the configs and clearing cache didn't work -- the frontend browser console reported a lot of js errors.
These are the steps that worked for me on Magento ver. 2.1.7 with Redis (not running Varnish). However, it's still unclear if everything is working as it should. JS is minified and bundled (unclear what merge is supposed to do). CSS is minified (not seeing it merged).
- Turn off all Magento cache.
- Clear redis cache.
- Turn all five css/js configs on (either in admin or via database).
- Generate static files.
- Clear Magento cache (command line). For safety (may not be required).
- Clear opcache (if not set to auto refresh).
- Refresh frontend home page (and check browser console for errors).
- Turn on Magento cache.
dev/css/merge_css_files = 1
dev/css/minify_files = 1
dev/js/enable_js_bundling = 1
dev/js/merge_files = 1
dev/js/minify_files = 1
Simply turning on the configs and clearing cache didn't work -- the frontend browser console reported a lot of js errors.
edited Jul 28 '17 at 4:46
answered Jul 26 '17 at 6:11
Aydus-MatthewAydus-Matthew
5301414
5301414
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
add a comment |
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
Merge will merge your files together into one.
– ladle3000
Oct 5 '18 at 13:45
add a comment |
Have you tried to flush the JavaScript/CSS? You can do this under System>Cache Management and then press the button which is on the bottom of the table on the left 'Flus JavaScript/CSS Cache'
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
add a comment |
Have you tried to flush the JavaScript/CSS? You can do this under System>Cache Management and then press the button which is on the bottom of the table on the left 'Flus JavaScript/CSS Cache'
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
add a comment |
Have you tried to flush the JavaScript/CSS? You can do this under System>Cache Management and then press the button which is on the bottom of the table on the left 'Flus JavaScript/CSS Cache'
Have you tried to flush the JavaScript/CSS? You can do this under System>Cache Management and then press the button which is on the bottom of the table on the left 'Flus JavaScript/CSS Cache'
answered Mar 15 '16 at 23:15
Mr. LewisMr. Lewis
1,288710
1,288710
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
add a comment |
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
YEP.... flush js, then cache. Nothing change. However, if I switch to Developer mode, the merge works.
– BrunoBueno
Mar 16 '16 at 17:03
add a comment |
You need to redeploy static after enabling this option in production mode.
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
add a comment |
You need to redeploy static after enabling this option in production mode.
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
add a comment |
You need to redeploy static after enabling this option in production mode.
You need to redeploy static after enabling this option in production mode.
answered Mar 16 '16 at 5:28
KAndyKAndy
15.9k23044
15.9k23044
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
add a comment |
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
The point is, I'm doing it. I just posted here what I did.
– BrunoBueno
Mar 16 '16 at 17:02
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
If it not works then problem maybe in in permission. Can you check your webserver access/errors log
– KAndy
Mar 17 '16 at 14:01
add a comment |
Make sure you check your NGINX configuration file as well.
If there is a variable $MAGE_MODE set there it needs to be changed to production as well, and save the file
After that you will need to reload or restart NGINX depending on your preference.
sudo service nginx reload
OR
sudo service nginx restart
After that check your app/etc/env.php and see if the MAGE_MODE array key is set to production as well if not change it to production or you can use the command
php bin/magento deploy:mode:set production
After you executed the command check if the value changed app/etc/env.php, sometimes there might be permission issues.
Next, clean out the pub/static folder.
rm -rf pub/static/*
Clear/Flush your cache
php bin/magento cache:clean
php bin/magento cache:flush
Now you are ready to execute the static content deploy
php bin/magento setup:static-content:deploy
Hope this helps.
add a comment |
Make sure you check your NGINX configuration file as well.
If there is a variable $MAGE_MODE set there it needs to be changed to production as well, and save the file
After that you will need to reload or restart NGINX depending on your preference.
sudo service nginx reload
OR
sudo service nginx restart
After that check your app/etc/env.php and see if the MAGE_MODE array key is set to production as well if not change it to production or you can use the command
php bin/magento deploy:mode:set production
After you executed the command check if the value changed app/etc/env.php, sometimes there might be permission issues.
Next, clean out the pub/static folder.
rm -rf pub/static/*
Clear/Flush your cache
php bin/magento cache:clean
php bin/magento cache:flush
Now you are ready to execute the static content deploy
php bin/magento setup:static-content:deploy
Hope this helps.
add a comment |
Make sure you check your NGINX configuration file as well.
If there is a variable $MAGE_MODE set there it needs to be changed to production as well, and save the file
After that you will need to reload or restart NGINX depending on your preference.
sudo service nginx reload
OR
sudo service nginx restart
After that check your app/etc/env.php and see if the MAGE_MODE array key is set to production as well if not change it to production or you can use the command
php bin/magento deploy:mode:set production
After you executed the command check if the value changed app/etc/env.php, sometimes there might be permission issues.
Next, clean out the pub/static folder.
rm -rf pub/static/*
Clear/Flush your cache
php bin/magento cache:clean
php bin/magento cache:flush
Now you are ready to execute the static content deploy
php bin/magento setup:static-content:deploy
Hope this helps.
Make sure you check your NGINX configuration file as well.
If there is a variable $MAGE_MODE set there it needs to be changed to production as well, and save the file
After that you will need to reload or restart NGINX depending on your preference.
sudo service nginx reload
OR
sudo service nginx restart
After that check your app/etc/env.php and see if the MAGE_MODE array key is set to production as well if not change it to production or you can use the command
php bin/magento deploy:mode:set production
After you executed the command check if the value changed app/etc/env.php, sometimes there might be permission issues.
Next, clean out the pub/static folder.
rm -rf pub/static/*
Clear/Flush your cache
php bin/magento cache:clean
php bin/magento cache:flush
Now you are ready to execute the static content deploy
php bin/magento setup:static-content:deploy
Hope this helps.
answered Sep 30 '16 at 5:13
Atish GoswamiAtish Goswami
3,38931646
3,38931646
add a comment |
add a comment |
I just did the following and the problem was solved.
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
(Here was the secret, to run the di:compile after production)
bin/magento setup:static-content:deploy
add a comment |
I just did the following and the problem was solved.
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
(Here was the secret, to run the di:compile after production)
bin/magento setup:static-content:deploy
add a comment |
I just did the following and the problem was solved.
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
(Here was the secret, to run the di:compile after production)
bin/magento setup:static-content:deploy
I just did the following and the problem was solved.
bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento deploy:mode:set production -s
bin/magento setup:di:compile
(Here was the secret, to run the di:compile after production)
bin/magento setup:static-content:deploy
edited Jul 26 '17 at 7:06
Devtype
2,18911332
2,18911332
answered Jul 26 '17 at 6:48
user52726
add a comment |
add a comment |
Please also enable "Enable JavaScript Bundling" option
store->configuration->advanced->developer->javascript setting->
Enable JavaScript Bundling set to "yes" And flush cache
1
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
add a comment |
Please also enable "Enable JavaScript Bundling" option
store->configuration->advanced->developer->javascript setting->
Enable JavaScript Bundling set to "yes" And flush cache
1
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
add a comment |
Please also enable "Enable JavaScript Bundling" option
store->configuration->advanced->developer->javascript setting->
Enable JavaScript Bundling set to "yes" And flush cache
Please also enable "Enable JavaScript Bundling" option
store->configuration->advanced->developer->javascript setting->
Enable JavaScript Bundling set to "yes" And flush cache
edited Jul 26 '17 at 7:17
Teja Bhagavan Kollepara
2,98641947
2,98641947
answered Sep 30 '16 at 4:56
Sagar DobariyaSagar Dobariya
1,0501827
1,0501827
1
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
add a comment |
1
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
1
1
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
Haphazard advice that has nothing to do with the question.
– ladle3000
Oct 5 '18 at 13:46
add a comment |
I've had the problem when the JavaScript is un-compiled the jquery selector works.
$('#my_element').click(function(){ alert('Hello World');});
But once compiled, compressed and joined, I then need to code:-
$('body #my_element').click(function(){ alert('Hello World');});
Don't ask why, it seems that when reading directly from the cache, the requirejs code executes before the domReady and the elements attach to different elements in some different page.
add a comment |
I've had the problem when the JavaScript is un-compiled the jquery selector works.
$('#my_element').click(function(){ alert('Hello World');});
But once compiled, compressed and joined, I then need to code:-
$('body #my_element').click(function(){ alert('Hello World');});
Don't ask why, it seems that when reading directly from the cache, the requirejs code executes before the domReady and the elements attach to different elements in some different page.
add a comment |
I've had the problem when the JavaScript is un-compiled the jquery selector works.
$('#my_element').click(function(){ alert('Hello World');});
But once compiled, compressed and joined, I then need to code:-
$('body #my_element').click(function(){ alert('Hello World');});
Don't ask why, it seems that when reading directly from the cache, the requirejs code executes before the domReady and the elements attach to different elements in some different page.
I've had the problem when the JavaScript is un-compiled the jquery selector works.
$('#my_element').click(function(){ alert('Hello World');});
But once compiled, compressed and joined, I then need to code:-
$('body #my_element').click(function(){ alert('Hello World');});
Don't ask why, it seems that when reading directly from the cache, the requirejs code executes before the domReady and the elements attach to different elements in some different page.
answered Jan 14 '18 at 2:51
Dallas ClarkeDallas Clarke
73779
73779
add a comment |
add a comment |
Delete cache manually var/cache and delete session manually var/session
1
Deletingvar/sessionis never an appropiate solution. magento.stackexchange.com/questions/94589/…
– Fabian Schmengler
Sep 14 '16 at 10:42
add a comment |
Delete cache manually var/cache and delete session manually var/session
1
Deletingvar/sessionis never an appropiate solution. magento.stackexchange.com/questions/94589/…
– Fabian Schmengler
Sep 14 '16 at 10:42
add a comment |
Delete cache manually var/cache and delete session manually var/session
Delete cache manually var/cache and delete session manually var/session
answered Mar 16 '16 at 18:05
Usman FayyazUsman Fayyaz
10412
10412
1
Deletingvar/sessionis never an appropiate solution. magento.stackexchange.com/questions/94589/…
– Fabian Schmengler
Sep 14 '16 at 10:42
add a comment |
1
Deletingvar/sessionis never an appropiate solution. magento.stackexchange.com/questions/94589/…
– Fabian Schmengler
Sep 14 '16 at 10:42
1
1
Deleting
var/session is never an appropiate solution. magento.stackexchange.com/questions/94589/…– Fabian Schmengler
Sep 14 '16 at 10:42
Deleting
var/session is never an appropiate solution. magento.stackexchange.com/questions/94589/…– Fabian Schmengler
Sep 14 '16 at 10:42
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f106436%2fmerged-js-and-css-do-not-work-when-production-mode%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Hello, Have you got any solution of this issue, I am getting same issue in magento 2.0.7. Please give the solution if you have any, Thanks
– Ashish Jagnani
Oct 3 '16 at 9:36