=>> 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?
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.
Tracking https://github.com/facebook/prepack/issues/24 instead.
Most helpful comment
According to the section The Environment matters! of https://prepack.io/,