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.
[InvalidArgumentException] Verify entered values of the argument and options. Unable to resolve the source file for 'frontend/lima/mdl/pt_BR/css/styles-m.less'
my files:
app/design/frontend/lima/mdl/registration.php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/lima/mdl',
__DIR__
);
app/design/frontend/lima/mdl/theme.xml
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Lima MDL</title>
<media>
<preview_image>media/preview.jpg</preview_image>
</media>
</theme>
app/design/frontend/lima/mdl/composer.json
{
"name": "lima/mdl",
"description": "N/A",
"require": {
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
"magento/framework": "101.0.*"
},
"type": "magento2-theme",
"version": "100.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
]
}
}
dev/tools/grunt/configs/themes.js
module.exports = {
blank: {
area: 'frontend',
name: 'Magento/blank',
locale: 'pt_BR',
files: [
'css/styles-m',
'css/styles-l',
'css/email',
'css/email-inline'
],
dsl: 'less'
},
luma: {
area: 'frontend',
name: 'Magento/luma',
locale: 'pt_BR',
files: [
'css/styles-m',
'css/styles-l'
],
dsl: 'less'
},
mdl: {
area: 'frontend',
name: 'lima/mdl',
locale: 'pt_BR',
files: [
'css/styles-m',
'css/styles-l'
],
dsl: 'less'
},
backend: {
area: 'adminhtml',
name: 'Magento/backend',
locale: 'pt_BR',
files: [
'css/styles-old',
'css/styles'
],
dsl: 'less'
}
};
I am running:
grunt clean; grunt exec; grunt less:mdl; sudo chmod 777 -R var/*;
I solved fixing permissions in all project, but I still don't know why...
1 Answer 1
You need to make sure that you run the commands from your Magento installation directory.
grunt clean: mdl
grunt exec: mdl
grunt less: mdl
chmod 0777 -R var/*
chmod 0777 -R pub/static/*
chmod 0777 -R generated/*
Grunt watch
-
Whatever you are hoping to accomplish (like here, apparently, post spam for your site),
chmod 777is wrong and dangerous. You absolutely do not want to grant write access to executable or system files to all users under any circumstances. You will want to revert to sane permissions ASAP (for your use case, probablychmod 755) and learn about the Unix permissions model before you try to use it again. If this happened on a system with Internet access, check whether an intruder could have exploited this to escalate their privileges.tripleee– tripleee2024年05月06日 09:10:55 +00:00Commented May 6, 2024 at 9:10