expo / expo-2d-context

A pure-js implementation of the W3C's Canvas-2D Context API that can be run on either Expo Graphics or WebGL
111 stars 7 forks source link

NPM hosts an old version that fails locally on web #25

Closed mabounassif closed 3 years ago

mabounassif commented 3 years ago

Hey all,

I'm super happy to have run across this project. While I am familiarizing myself with the code base (so that I can contribute if needed) I've noticed a broken OOB experience. If I install expo-2d-context on a newly created expo project I get the following error:

./node_modules/expo-2d-context/bmfont.js:30:31
"export 'Asset' was not found in './utilityObjects'
  28 |       let wrapped_assets = {}
  29 |       Object.keys(image_assets).map(function(key, index) {
> 30 |          wrapped_assets[key] = Asset.fromModule(image_assets[key]);
     |                               ^
  31 |       });
  32 |       this.images = wrapped_assets
  33 |     } else {

which at first glance seems to be related to an outdated version of the project on npm.com (I'm assuming last published is 3 years ago): https://www.npmjs.com/package/expo-2d-context

Steps to reproduce:

  1. Install expo 4.12.1
  2. Run expo install expo-gl expo-2d-context
  3. Run npm run web
mabounassif commented 3 years ago

Installing straight from master, I get the following error:

./node_modules/expo-2d-context/src/Expo2DContext.js:67:11
"export 'default' (imported as 'parseColor') was not found in './cssColorParser'
  65 | export function cssToGlColor(cssStr) {
  66 |   try {
> 67 |     return parseColor(cssStr);
     |           ^
  68 |   } catch (e) {
  69 |     return [];
  70 |   }