Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import colyseus in React Native? #19

Closed
Goblin-Knight opened this issue Jan 20, 2018 · 3 comments
Closed

How to import colyseus in React Native? #19

Goblin-Knight opened this issue Jan 20, 2018 · 3 comments

Comments

@Goblin-Knight
Copy link

My Code in React Native is below, but i got "Can't find variable:Symbol"

import 'react-native-browser-polyfill';
import React, { Component } from 'react';
import * as Colyseus from "colyseus.js";
import {
Text, View, AsyncStorage
} from 'react-native';
window.localStorage = AsyncStorage;

export default class App extends Component<{}> {
render() {
return (
...
);
}
}

@endel
Copy link
Member

endel commented Jan 20, 2018

Hi @Goblin-Knight,

Are you using Android for testing? This comment explains the problem: facebook/react-native#15805 (comment)

You can fix this by requiring es6-symbol polyfill:

npm install es6-symbol

Import the polyfill in your main.js:

require('es6-symbol/implement');

Cheers

@Goblin-Knight
Copy link
Author

Many Thank!!! yes, i am using Android for testing, thank @endel to told me the problem that cause by enable debugger feature, let start develop~ :)

@endel
Copy link
Member

endel commented Jan 20, 2018

You're welcome!

@endel endel closed this as completed Jan 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants