-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore undefined content in generating source maps #3360
Conversation
Are there any suggestions for moving forward with this? |
Seems clear. Thanks! |
Has this been released? |
I'm also waiting for next release. This fix would really help me. |
This hasn't been released yet, so until it is, I'd just remind people that disabling source maps is one way to work around the problem for now. |
This fix causes some rules to dissapear |
@elios264 Can you explain further? Do you have examples and reproduction steps? How were you able to verify this fix caused rules to disappear? |
I'll try to code a simplified version of my project this night, unfortunately it seems that the simpler the project (less compile time), the harder to reproduce the bug is, with this fix we are avoiding this code from crashing the process, but if we just silence the bug, we would be hiding the real problem which is less somehow not processing some mixins in the first compilation. |
So how do you know that? |
A reproducible demo is here, just type npm install and npm start |
@elios264 Your demo shows the Less dependency as 3.9.0, which would not include the fix which was merged here (and not yet released). Did you set a dependency to current master? How were you testing the fix? |
in package.json scripts section there's a postinstall hook, that patches the lib in node_modules with the patch file located in patches/lessXXXXX.patch |
@elios264 Ah ok. I will try to take a look when I get the chance. |
@elios264 Your test case / demo unfortunately has way too many layers to definitively say that the problem is within Less and if so, where it might be. Could also be Webpack and its associated loaders, the Less loader, splitting / bundling plugins, etc. Could of course very well be Less, but we would need a reduced case that only uses |
If this is still an issue in v3.10.0-beta, please open a bug report with a simplified test case. |
In case the above comments are confusing for anyone else, the fix went out in 3.10.0: 5cc99b5 |
When building with angular-cli and lazy loaded modules, there are empty files with no content. This produces an unfortunately cryptic error message: "cannot call substring of undefined. File 'undefined', line 'undefined'"
After much investigation I found this to be the source of the issue. I don't really know root cause, but I think it has to do with webpack's module splitting. Maybe files in split modules aren't immediately available? At any rate, this fixes it and seems in line with behavior at the start of the file.