Prepack: Got TypeError "not an object" in `prepack main.js`

Created on 4 May 2017  路  2Comments  路  Source: facebook/prepack

=>> prepack main.js --out main.min.js
not an object
TypeError
    at main.js:55030:7

which points to https://gist.github.com/yong-chen04/4cf22d25c681eda95eb6baf41eb41635

if (typeof polyfill.core.ctx !== 'undefined');
else polyfill.core.ctx = typeof document !== 'undefined' &&
    typeof window !== 'undefined'
    ? document.createElement('canvas').getContext('2d') // <---- this line
    : null;

is that because the DOM API here?

question

Most helpful comment

According to the section The Environment matters! of https://prepack.io/,

Prepack has no built-in knowledge of document or window. In fact, when prepacking code which references such properties, they will evaluate to undefined.

All 2 comments

According to the section The Environment matters! of https://prepack.io/,

Prepack has no built-in knowledge of document or window. In fact, when prepacking code which references such properties, they will evaluate to undefined.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

phpnode picture phpnode  路  3Comments

NTillmann picture NTillmann  路  3Comments

matheusml picture matheusml  路  8Comments

MichaelBlume picture MichaelBlume  路  6Comments

NTillmann picture NTillmann  路  4Comments