Grunt generate wrong less sourceMaps path, both Chrome and Firefox can not find sourceMaps files
OS: Ubuntu 18.04 with apache and php 7.1.x
Magento Version: 2.3.0
It is very difficult to reproduce on on vanilla Magento instance, as the issue need a lot of CLI operations to install node.js, npm etc.
Use Grunt to compile Less file, and Grunt add sourceMaps path is:
/*# sourceMappingURL=pub/static/frontend/Magento/luma/en_US/css/styles-l.css.map */
In order to let browser to find the sourceMpas file, it should be
/*# sourceMappingURL=styles-l.css.map */
Try to change less.js but failed.
Hi @gizmocn. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release
For more details, please, review the Magento Contributor Assistant documentation.
@gizmocn do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?
@magento-engcom-team give me 2.3-develop instance - upcoming 2.3.x release
Hi @gizmocn. Thank you for your request. I'm working on Magento 2.3-develop instance for you
Hi @gizmocn, here is your Magento instance.
Admin access: https://i-20952-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.
I have tried vanilla Magento instance, but I have no idea about how to run CLI command on it, the issue need to install node.js npm and grunt etc.
@magento-engcom-team give me 2.3-develop instance
Hi @amol2jcommerce. Thank you for your request. I'm working on Magento 2.3-develop instance for you
Hi @amol2jcommerce, here is your Magento instance.
Admin access: https://i-20952-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.
Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[x] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[x] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[x] 4. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento-engcom-team give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Verify that the issue is reproducible on 2.2-develop branch. Details
- Add the comment @magento-engcom-team give me 2.2-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x
[x] 6. Add label Issue: Confirmed once verification is complete.
[x] 7. Make sure that automatic system confirms that report has been added to the backlog.
:white_check_mark: Confirmed by @engcom-backlog-nazar
Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-98051 were created
Issue Available: @engcom-backlog-nazar, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._
Hi @gizmocn, I'm not able to reproduce your issue. Please, take a look at my steps and add additional steps/information to reproduce this issue.






@omiroshnichenko node -v v11.9.0

Hi all sorry i'm have wrong configuration, now all works as expected.

Hi all sorry i'm have wrong configuration, now all works as expected.
@engcom-backlog-nazar What did you? I have the same issue.
Thanks in advance
@tratta i am facing same issue, in browser not showing source map, can you please help us on that.
@sunilit42 I made some changes on theme
x3: {
area: 'frontend',
name: 'Grudado/x3',
locale: 'pt_BR',
options: {
sourceMap: true,
strictImports: false,
sourceMapRootpath: '/',
dumpLineNumbers: false, // use 'comments' instead false to output line comments for source
ieCompat: false
},
files: [
'css/styles-m',
'css/styles-l',
'css/email',
'css/email-inline'
],
dsl: 'less'
},
and less.js
var lessOptions = {
options: {
sourceMap: true,
strictImports: false,
sourceMapRootpath: '/',
sourceMapFileInline: 'true',
dumpLineNumbers: false, // use 'comments' instead false to output line comments for source
ieCompat: false
},
setup: {
files: {
'<%= path.css.setup %>/setup.css': '<%= path.less.setup %>/_setup.less'
}
},
updater: {
files: {
'<%= path.css.updater %>/updater.css': '<%= path.less.setup %>/_setup.less'
}
},
documentation: {
files: {
'<%= path.doc %>/docs.css': '<%= path.doc %>/source/docs.less'
}
}
};
It worked for me rename package.json.example to package.json, that is what I was missing. :-)
Make sure that the name you set in the grunt config "matches" the path which you have set in the registration.php of your theme. For example I set the name in the grunt config to Company/Base but in my registration.php it was set to 'frontend/company/base'. So I had to change the name in the grunt config to company/base. More details.
Most helpful comment
@sunilit42 I made some changes on theme
and less.js