Doesn't work with Modernizr
Opened this issue · 7 comments
When I use:
<script src="stc/js/default/modernizr.custom.98457.js"></script><script type="text/javascript">
Modernizr.load([{
test : Modernizr.cssvhunit,
nope : 'stc/js/default/vimpoly.min.js',
}]);
Only works when opera 12 and never on the browser of Android 4.1
I'm maintaining the project again. Did you solve this problem?
It seems like it would be an issue with Modernizr.
I could not: /
I'm having similar issues with using Modernizr, tho I'm worried I may not be implementing vminpoly correctly. Here's my modernizr script:
Modernizr.load([
{
test : Modernizr.cssvwunit && Modernizr.cssvhunit,
nope : ['polyfills/parser.js', 'polyfills/tokenizer.js', 'polyfills/vminpoly.js']
}
]);
And this is the error I get back:
INFO: processing http://localhost:8888/css/style.css vminpoly.js:45
Parse error at token 1958: {.
Attempt to open a curly-block in a statement-type at-rule. parser.js:56
Parse error at token 2038: {.
Attempt to open a curly-block in a statement-type at-rule. parser.js:56
Parse error at token 2118: {.
Attempt to open a curly-block in a statement-type at-rule. parser.js:56
Parse error at token 2680: DELIM(*). parser.js:56
Uncaught TypeError: Cannot read property 'append' of undefined parser.js:62
Note: This issue seems to persist even without Modernizr. I tried directly loading the vminploy scripts in the HEAD section, and still received an identical array of errors.
@seavor this looks like an issue with tabatkin's parser. He's been improving his own repository lately so it might be fixed there, but his changes still haven't been integrated into vminpoly.
As a quick, hacky fix, you might try removing whitespace from the CSS file.
Doing this has avoided some parsing errors before.
I know it's not the proper solution. But these days I can't pay attention to the code. Hopefully this will change soon.
I'm getting the same error even though my css is minified, any news on this?
I had a problem in ImpressPages. It was hard to find because IP uses less css and source and outcome differ. Turned out the problem was caused by
@-webkit-keyframes
Adding it to the registry fixed the problem.
AtRule.registry = {
'import': '',
'media': 'rule',
'font-face': 'declaration',
'page': 'declaration',
'keyframes': 'rule',
'-webkit-keyframes': 'rule', // note: this line was added
'namespace': '',
'counter-style': 'declaration',
'supports': 'rule',
'document': 'rule',
'font-feature-values': 'declaration',
'viewport': '',
'region-style': 'rule'
};
To find your problem you can either step through the AtRule()
fuction or add a console.log like so:
function AtRule(name) {
this.name = name;
this.prelude = [];
this.value = [];
console.log(name); // todo: remove this line
if(name in AtRule.registry)
this.fillType = AtRule.registry[name];
return this;
}
The name that outputs right before your error is the misunderstood css tag.