-
Notifications
You must be signed in to change notification settings - Fork 221
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
Crash on unexpected properties #398
Comments
Hi, I stumbled across the same issue. However if you look at the CSS sample you provided you see two CSS violations:
Therefore the CSS parser "mensch" used here is producing an invalid AST (as it claims it is not validating the CSS). This invalid AST leads then to a property access in the inline.js line 205. There ".snippet" is interpretetd as css property without value. The var value, with undefined, is accessed with '.match(...' which leads to the crash. Solution propsals:
|
Hello. You are absolutely right the email I provided has broken CSS. I should have mentioned it in the beginning but unfortunately, we can't control all the emails that we get. It's a kind of public service and anybody can send one. But we would like juice not to crash at least. I added the following hack back then
It's ugly but after 2 months we haven't found any issues with it. |
Hi, I meet the same issue, juice crash but there's no error, and the callback is never called. |
I rechecked the code and found an error ( |
thanks. I found the exception is caused by the inifinite loop when the css includes |
Hello, we use juice to parse incoming emails and recently we got an email that causes juice to crash without any chance to catch the error. We narrowed it down to a simple example that gives the following error:
The callback is never called and try/catch can't catch the error either. The code to reproduce:
node: v14.18.1
juice: 8.0.0
The text was updated successfully, but these errors were encountered: