Questions tagged [grunt]
The grunt tag has no usage guidance.
133
questions
1
vote
1
answer
1k
views
(Magento2) Grunt Less problem with a new theme
I've cloned the blank theme for app/design/frontend/lima/mdl, swapping Magento/blank for lima/mdl and give this error:
Processed Area: frontend, Locale: pt_BR, Theme: lima/mdl, File
type: less.
...
7
votes
2
answers
6k
views
LiveReload configuration via Grunt
Edit : about the possible duplicate !
I would like to mention that this answer does not answer my question, if someone sees that it is the same thing, I invite him to answer me instead of saying that ...
1
vote
1
answer
28
views
Change livereload host
The default livereload host is 127.0.0.1, but I have the access problems to access the this host directly in WSL2. Need to change it to http://localhost:35729/livereload.js Found the solution to ...
2
votes
1
answer
301
views
Magento 2 - Can't compile new theme, which inherits from luma
I created a new minimalistic theme in a fresh Magento 2.4.2
The theme inherits from Magento/luma
Example:
app/design/frontend/company/foo/registration.php:
<?php
/**
* Copyright © Magento, Inc. ...
0
votes
2
answers
547
views
Magento 2 : How Can I Add custom.less File For Only Specific Page?
how can i add custom.less file for any specific page in child theme? means don't need genrate inside my custom css code in style-l.css or style-m.css and i have already 2 methods used.
Method 1.
...
9
votes
2
answers
2k
views
Grunt theme source files missing when running Grunt exec
I have a theme that extends the Luma theme. I am trying to get Grunt working to do preprocessing. So far, I don't have any changes/additions in my theme at all. I setup my themes.js as follows:
...
2
votes
3
answers
2k
views
Magento 2 - css source maps not working
I created a new theme which extends from magento luma. I try to develope with less instead of css.
I need to enable CSS Source maps, so that I can debug my less, it helps to see in which less files ...
0
votes
0
answers
271
views
.less file source map not showing in web browser with Magento 2.4.4
i have use magento 2.4.4 and 2.4.5. this issue happen on both of versions. i have configure grunt properly & less compile working fine but does not show source map in browser inspect element : ...
1
vote
1
answer
4k
views
Grunt: Destination [src path] not written because no source files were found
Currently working with a Magento 2.2.0 theme I made from scratch and I am using Grunt task runner to compile the LESS files to css.
Theme structure in app/design/frontend/<vendor>/<...
0
votes
0
answers
25
views
Magento 2: Js file not created once we execute the grunt command
I have added the grunt but when i execute the below command then css file is generated but js file is not created inside the pub/static/frontend/
Missing file is : en_US/requirejs/require.js, en_US/...
0
votes
0
answers
38
views
Luma Child Custom Theme Grunt not copying js files
Magento 2.4.4 running on Xampp Windows 10. Luma Child Custom Theme Grunt not copying js files
When i do a normal "deploy" from cli its fine.
php bin/magento setup:static-content:deploy
when ...
0
votes
1
answer
892
views
Unable to get Grunt less task working on Custom Magento theme
Good morning,
I'm pretty new to Magento 2 and I'm currently in the process of trying to get my first custom M2 theme up and running.
I have managed to create my new theme but running into trouble ...
2
votes
3
answers
2k
views
Error when running grunt exec
I have followed the docs for setting up Less compilation. Running grunt clean and grunt less works without errors, but when I run grunt exec (with or without appending a specific theme name) I get the ...
7
votes
2
answers
281
views
Different less compilation results between grunt and server side compilation
I got the following theme inheritance setup:
Vendor/Retail inherits from Vendor/Default which inherits from Magento/blank
When compiling the styles with grunt I get no issues. When compiling with ...
0
votes
1
answer
385
views
CSS Source Maps are empty after grunt refresh
On Magento 2.4.1, Developer Mode and SSR after running
grunt clean
grunt exec
grunt less
# OR
grunt refresh
Generated Source Maps looks like this
{"version":3,"sources":[],"...
1
vote
3
answers
337
views
What is Grunt in Magento2 and Why use?
What is Grunt in Magento2? Why use grunt. I want to know detail about Grunt. When we can use Grunt.
1
vote
0
answers
17
views
Different frontend CSS results (Grunt vs deploy:mode:set production)
I have a weird issue where the frontend results of a grunt compile are different compared to a compilation after deploy:mode:set production. UI elements are different. Why is that?
How can I debug/...
6
votes
4
answers
7k
views
Error after grunt clean
Magento 2
After running: grunt clean and then grunt exec:myTheme I get the following
error: >> [InvalidArgumentException]
There are no commands defined in the "dev:source-theme" namespace.
...
1
vote
1
answer
888
views
Magento 2 - Could not load content for ... (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
I am using grunt with livereload to compile my less files. Grunt also generates source maps so that I can directly see in my browser, in which LESS files css code is located.
But often when I click to ...
0
votes
2
answers
772
views
Magento 2.4.1. Grunt exec error
I have tried this on a clean install of magento 2.4.1
I then went to a magento 2.3.6 ran grunt exec and grunt less both worked
After upgrading the 2.3.6 to 2.4.1 the grunt exec then failed with the ...
3
votes
3
answers
6k
views
Magento 2 Theme Development - grunt watch not detecting changes of custom LESS file
We are running Magento 2 in version 2.3.1, but the error occurred in version 2.3.0 also. The situation is the following:
we've created a custom theme which has Magento/luma theme as parent.
according ...
0
votes
0
answers
164
views
Magento 2.4 alternatives to Livereload Chrome extension for live styling via Grunt?
Magento officially recommends Livereload for "watching" changes made via Grunt and updating the browser in real-time without reloading the page for each change here: https://devdocs.magento....
1
vote
1
answer
6k
views
Run Grunt deploy task -> Fatal error: Class 'Locale' not found
I NodeJs installed, I installed the Magento2 Grunt that works, but if I run the command "grunt deploy" it delete all from the folder pub/static/ but do not deploy and returns me the error below. Can ...
4
votes
2
answers
2k
views
Grunt watch doesn't watch _theme.less and custom less file
That's my css/source file structure:
https://i.stack.imgur.com/5tNxJ.png
I made grunt clean, theme exec, theme less, watch.
Watch is responsive to any less file changes accept of _theme.less and ...
7
votes
3
answers
3k
views
Magento 2. Less to CSS. Very slow building process. How to improve?
Currently magento2/grunt is very slow in transforming less to css (with a few locales it can take up to a minute to rebuild everything.
Any tips how to improve development speed?
0
votes
1
answer
613
views
Magento 2 - Can't compile theme in production mode anymore | Unable to retrieve deployment version of static files from the file system
I get this error when trying to execute grunt refresh or grunt exec:all.
[2020-08-17 05:25:31] report.CRITICAL: Can not load static content version. [] []
[2020-08-17 05:25:31] report.ERROR: Unable to ...
0
votes
2
answers
340
views
Grunt exec clear pub folder
When i use grunt exec:theme it clears all files in pub/static but does not copy new images, scripts and fonts.
I dont have any errors in CLI.
I clear all cache and i use grunt refresh.
2
votes
0
answers
278
views
Magento2 eslint entire custom code
I've noticed Magento2 has Javascript Coding Standards, in which they reference an eslint config file.
Suppose I have an M2 project I'm developing with a large group of folks and I'd like the team to ...
0
votes
0
answers
1k
views
How to install grunt within docker container?
I finally was able to finish installing M2 enterprise cloud on docker for local dev, and the one final step is to install grunt so I can do some frontend work. I've been trying to wrap my head around ...
0
votes
1
answer
221
views
Static content generation: problems with grunt exec and grunt less
I'm working on a Magento 2.3.4 website that has a custom theme, developed by a different party. I need to modify some .less files and I noticed something strange. grunt exec, that should publish the ...
3
votes
4
answers
3k
views
Magento 2 + Livereload
I am currently in the middle of setting up a front end workflow for Magento 2, however I am currently unable to get livereload to work. Everything I have read so far on various tutorials and the ...
1
vote
1
answer
697
views
locally installed grunt, "grunt exec:blank" fails with "/bin/sh: grunt: command not found"
I am hosted at Nexcess and tried to implement Grunt to assist with LESS development. I followed the Magento 2 docs for installing grunt. NodeJS 10.10.0 is installed.
The first deviation from the ...
1
vote
1
answer
148
views
Is it absolutely REQUIRED that you install grunt globally for it to work out of the box with Magento 2?
Documentation at https://devdocs.magento.com/guides/v2.3/frontend-dev-guide/tools/using_grunt.html states to install grunt using the -g (global) command, which requires elevated privileges. ...
1
vote
6
answers
887
views
run grunt in mangeto 2
Already follow from this dev document this
1.npm install -g grunt-cli
2.Rename 3 files
- package.json.sample into package.json
- Gruntfile.js.sample into Gruntfile.js
- grunt-config.json.sample ...
0
votes
1
answer
52
views
Magento2 how to define theme in my themes.js
What is the correct way to define theme in theme.js
dev/tools/grunt/configs/themes.js
My theme in app/design is Hose/Fit
<theme>: {
area: '<area>',
name: '<Vendor>/<...
0
votes
1
answer
156
views
Magento2 grunt error
> npm install -D load-grunt-config
npm WARN deprecated coffee-script@1.12.7: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm ERR! Linux 4.15.0-52-generic
npm ERR! argv "/usr/bin/...
2
votes
1
answer
720
views
SyntaxError: Cannot read property 'numerator' of undefined in pub\static\fron \package\theme\en_US\css\source\lib\_responsive.less
SyntaxError: Cannot read property 'numerator' of undefined in
pub\static\frontend\package\theme\en_US\css\source\lib_responsive.less
on line 44, column 9:
43 @media only screen and (max-width: ...
0
votes
1
answer
2k
views
Magento 2 LESS - Unable to resolve the source file for ..., after deleting source file
I deleted a less file which I don't need anymore. I also removed the entry from default_head_blocks.xml so that it does not load anymore.
I searched my whole theme for main.css and removed all ...
1
vote
1
answer
567
views
Magento 2 - Grunt watch not detecting changes of _extend.less
I have these files:
THEME = app\design\frontend\company\base
THEME\web\css\source\lib\extend\variables\_typography.less
THEME\web\css\source\lib\extend\variables\_colors.less
THEME\web\css\source\...
0
votes
1
answer
720
views
Magento 2 - LiveReload is connected, but changes are only visible after manual reload
I try to use grunt watch in combination with livereload. But there is almost no documentation on the topic.
I installed livereload like this:
npm install -g livereload
Then I added the following ...
0
votes
1
answer
383
views
Magento 2 local Docker - running less:theme fails for file not found, but file is present
I finally have a local docker setup for my Magento 2 development set up. It works fine everywhere, except for when I run grunt less:MyTheme. When I do that I get this error
Running "less:MyTheme" (...
1
vote
1
answer
3k
views
Magento2: Missing commands on build server
I try to make a Magento2 Pipeline Deployment and running in a awkward error.
But first a few words to the deployment:
I use a docker container with installed php and nodejs.
I copy in the container ...
5
votes
6
answers
9k
views
How to Configure Magento2 with Gulp instead Grunt
How to configure Magento2 with Gulp instead Grunt.
Anyone have idea ?
1
vote
1
answer
534
views
i cant set up grunt due an error
i want to create luma based theme and set up grunt for it.
path to .less files: frontend///web/css/source/style-l.less
im getting an error: unable to resolve the source file for 'frontend/<vendor&...
1
vote
1
answer
99
views
Grunt workflow, problems with watch task and reloading
I've been trying to get the "grunt watch" task running combined with livereload but unfortunately I'm not able to get a working solution. I've read the magento devdocs but running a combination of the ...
0
votes
1
answer
156
views
Add grunt-notify to M2 Grunt config
How to add grunt-notify module to Magento 2 Grunt config.
Reference: https://github.com/dylang/grunt-notify
Thanks.
0
votes
2
answers
52
views
Magento 2.3 grunt compile
My simple question is that, Do i need to compile less with grunt in magento?
My theme is working fine. However i am not sure that i need to compile less with grunt or not.
Is there any impact on ...
2
votes
1
answer
796
views
Debugging LESS files with Firebug / Chrome Dev tools Magento 2
I am trying to figure out how to display the LESS file and line number pre compilation in developer tools so that I can see where I need to be editing. I have previously got this up and running with ...
3
votes
1
answer
2k
views
See less source files in chrome dev tools
How do you see the less file that is generating the style in chrome dev tools?
working in developer mode, in less.js:
var lessOptions = {
options: {
sourceMap: true,
and in config.less....
8
votes
2
answers
857
views
Grunt compile of LESS fails with Error compiling lib/web/css/docs/source/docs.less
I'm hoping to get some advice. I pulled a project that I haven't touched in some time and in developer mode I ran 'grunt exec' followed by 'grunt less' and once running 'grunt less' I receive the ...