-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Error: "Cannot read properties of null (reading 'rules')" #78
Comments
'svglint' is just broken on ubuntu at the moment. Uncomment when simple-icons/svglint#78 is addressed.
Possible fix for simple-icons#78. Not sure I've used 'hasOwnProperty' correctly, but this at least works for me when there is no user config.
Just to double check, latest being v2.3.0 (you can double check this by running
Does that imply it did work for you at some point in the past? If so, what version of svglint did work for you?
It seems something's going wrong with your configuration file. Could you share the configuration file (or a representative sample) or the whole project you're working with if it's publicly available? |
There's no configuration file at all. This is being run as part of a github action, where svglint is installed from npm, and then immediately used. I'm not sure which version it was when it worked, but I know it used to work, and now fails--this could be due to any number of things, unfortunately, up to and including ubuntu itself being updated. Here's the 'live' result of svglint failing: https://github.com/biosimulations/biomodels-qc/actions/runs/4516731122/jobs/7955350793 The test is just 'run svglint on a png file'. From when it used to work: https://github.com/biosimulations/biomodels-qc/actions/runs/2150934692/jobs/3143682354 The workflow file is: https://github.com/biosimulations/biomodels-qc/blob/dev/.github/workflows/ci.yml The python code that calls the function is just: def validate_svg_file(filename):
""" Determine if a SVG file is valid
Args:
filename (:obj:`str`): path to SVG file
Returns:
:obj:`tuple`:
* nested :obj:`list` of :obj:`str`: nested list of errors
* nested :obj:`list` of :obj:`str`: nested list of warnings
"""
result = subprocess.run(['svglint', filename], check=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if result.returncode == 0:
return [], []
else:
return [[result.stderr.decode()]], [] Investigating, I ran the same commands on my VirtualBox Ubuntu machine, and got the 'failed to lint file' error above. Results from 'npm ls svglint':
#79 shows a fix that works for me (with no config file), though it fails the automatic tests here. Thanks for looking into this! |
Thanks for elaborating. Based on the "no-configuration-file-at-all" I was able to reproduce the issue. I was also able to determine that the issue first appeared in v2.2.0. If you need a quick solution for your CI, you can change this line as follows: - run: npm install -g svglint
+ run: npm install -g [email protected]
Thanks for the details. the
I saw, thanks for jumping in with a fix! Just wanted to understand the problem better before looking at that - will try to look at this as soon as possible. |
Thanks so much! An immediate workaround and the promise of a fix is great. |
🎉 This issue has been resolved in version 2.3.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Works for me! Thanks again. |
When running the latest svglint on ubuntu, it's failing to do any linting; I assume the problem stems from some recent update to svglint or one of its dependencies.
Here's what I get when trying it:
This happens regardless of the file I point it at, whether an actual SVG file or otherwise.
The text was updated successfully, but these errors were encountered: