Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Unhandled rejection TypeError cannot read property 'prototype' of undefined #1

Open
drewandrew opened this issue Mar 22, 2017 · 1 comment

Comments

@drewandrew
Copy link

I am returning an Unhandled rejection TypeError cannot read property 'prototype' of undefined error when using gulp-inline-css with preserveMediaQueries: true to preserve the media query:

@media screen {
  @font-face {
    font-family: 'Roboto';
    font-style: normal;
    font-weight: 400;
    src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v15/2UX7WLTfW3W8TclTUvlFyQ.woff) format('woff');
  }
}

Other media queries are working properly, but @font-face seems to throw an error that I cannot decipher. The full error is as follows:

Unhandled rejection TypeError: Cannot read property 'prototype' of undefined
    at C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\mediaquery-text\ind
ex.js:37:107
    at Array.forEach (native)
    at C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\mediaquery-text\ind
ex.js:36:28
    at Array.forEach (native)
    at module.exports (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\med
iaquery-text\index.js:23:11)
    at Object.<anonymous> (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules
\style-data\index.js:39:32)
    at initialize.exports.each (C:\Users\Andrew\Desktop\Localvore\Markup\node_mo
dules\cheerio\lib\api\traversing.js:293:24)
    at module.exports (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\sty
le-data\index.js:25:16)
    at C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\extract-css\index.j
s:14:9
    at next (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\batch\index.j
s:118:7)
    at Batch.end (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\batch\in
dex.js:154:5)
    at module.exports (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\ext
ract-css\index.js:24:11)
    at C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\inline-css\lib\inli
neContent.js:15:9
    at tryCatcher (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\bluebir
d\js\main\util.js:26:23)
    at Promise._resolveFromResolver (C:\Users\Andrew\Desktop\Localvore\Markup\no
de_modules\bluebird\js\main\promise.js:483:31)
    at new Promise (C:\Users\Andrew\Desktop\Localvore\Markup\node_modules\bluebi
rd\js\main\promise.js:71:37)

@Daylon
Copy link

Daylon commented Jul 23, 2017

I ran into the same issue yesterday and found out that the currently published CSSOM on npm is missing parts of its functionalities. Its prepublish script may have failed —Anyway. For the time being, we'll have to run its Jake build script ourselves before using mediaquery-text.

Also: @font-face check is missing in the test suite.

Daylon added a commit to Daylon/mediaquery-text that referenced this issue Jul 23, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants