Modules available in Snack


#1

We’re working on a way to allow Snacks to access any npm package, but until that’s ready, it comes bundled with the following packages:

@expo/ex-navigation: 3.0.0
@expo/vector-icons: 5.0.0
apollo-client: 1.3.0
assert: 1.4.1
babel-preset-expo: 2.0.0
babel-standalone: 6.24.2
babylon: 6.17.2
base-64: 0.1.0
date-fns: 1.28.5
expo: 18.0.1
gl-mat4: 1.1.4
graphql-tag: 2.2.0
hsv2rgb: 1.1.0
immutable: 3.8.1
lodash: 4.17.4
mobx: 3.1.10
mobx-react: 4.1.8
os: 0.1.1
pubnub: 4.2.3
react: 16.0.0-alpha.12
react-apollo: 1.2.0
react-native: https://github.com/expo/react-native/archive/sdk-18.0.1.tar.gz
react-native-elements: 0.12.2
react-native-tab-view: 0.0.66
react-navigation: 1.0.0-beta.11
react-redux: 5.0.5
react-router-native: 4.1.1
recast: 0.12.5
redux: 3.6.0
redux-effex: 1.1.2
redux-logger: 3.0.6
redux-thunk: 2.2.0
regl: 1.3.0
seamless-immutable: 7.1.2
socket.io-client: 2.0.1
styled-components: 2.0.0
subscriptions-transport-ws: 0.7.0
three: 0.85.2
url-parse: 1.1.9
uuid-js: 0.7.5
validator: 7.0.0

Requiring unknown module "pixi.js". NPM is available in Snack?
#2

Any chance of adding NativeBase (nativebase.io)?


#3

All npm packages? Great!


#4

moment is not available ?

A version number gets added in my code, like:
import moment from ‘moment’;
// 2.18.1

But the preview gives me the error “Trying to import unknown module ‘moment’”


#5

We’re still doing some stabilization, and the arbitrary imports aren’t yet in a place where it just works every time. Sorry for the growing pains!

Moment is available though: https://snack.expo.io/SJhOb7cPb


#6

Hi guys, any update on this?
Im still having issues with third party modules …


#7

This is top priority for us right now. Specific reports of things that are failing for you are helpful to make sure we catch all the corner cases.

We’re currently aware of issues with:
deep imports from npm modules (eg lodash/XXX)
native-base
react-native-import-scroll-view


#8

Thanks @thetc, i will be waiting …


#9

Having issues importing victory-native as well: https://snack.expo.io/rkvsY2Yje


#10

We’ve made some good progress covering more of npm:

  • deep imports should now work (this issue also affected react-native-input-scroll-view)
  • victory-native (and other modules expecting access to react-native-svg) https://snack.expo.io/B1yu1E5xM

But we still have more to go:

  • native-base
  • pixi.js

Keep those issue reports coming!


#11

@thetc Thanks for the progress! I have tried this one:
https://www.npmjs.com/package/react-native-canvas

And is, unfortunatey, not available. I wonder why.


#12

here is the snack to replicate the issue
https://snack.expo.io/BJGB0oAeM


#13

I don’t believe that library works in expo generally :confused:


#14

Why? It’s just a webview wrapped as a component


#15

would be nice to support glamorous-native


#16

Would it be possible to have https://github.com/algolia/react-instantsearch in Expo Snack :smiley:


#17

@louisjs Haven’t taken it all the way, but it seems like yes: https://snack.expo.io/B1shLrZXM


#18

@davidgortega Sorry, I knew we were working on getting canvas support into Expo and assumed that would be caught up by the same issues.

Sometimes modules will have a peer dependency that the module author assumes will be available and doesn’t explicitly list. You’ll now get a message saying Failed to install module 'x': Attempted to import missing module 'y' and you can resolve for yourself by importing the missing dependency (in this case regenerator-runtime)

https://snack.expo.io/SJgMYBbmM


#19

I am getting this error:
Device: (1:0) Error loading dependency: Error: Failed to install module 'native-base': Attempted to import missing module '@expo/vector-icons/Ionicon'

Link to my snack: https://snack.expo.io/@rbagchi/todoapp
Am I missing something?


#20

You have a circular dependency in TodoService, but that’s a very strange error for us to display!
Also, Firebase doesn’t like being reinitialized, which snack does very often, so you need to wrap the initializeApp call in a try catch:

https://snack.expo.io/H1lN-TtUG