Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Syntax Error: Unexpected Token, expected }

An error Unexpected token, expected } suddenly appeared without a clear cause.

enter image description here

Line 136:7 is right where it says master: {

const styles = StyleSheet.create({
	master: {
		flex: 1,
		justifyContent: 'center',
		flexDirection: 'row',
		alignItems: 'center',
		flexWrap: 'wrap'
	}
});

It was working fine before. I have tried:

rm -rf node_modules && npm install
npm start -- --reset-cache

No changes from either of those.

like image 215
softdownfeathers Avatar asked Mar 07 '17 21:03

softdownfeathers


People also ask

What is syntax error Unexpected token?

The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided. This might be a simple typo.

How do I fix an unexpected token?

As you write your JavaScript application, the unexpected token error always occurs because JavaScript expected a specific syntax that's not fulfilled by your current code. You can generally fix the error by removing or adding a specific JavaScript language symbol to your code.


1 Answers

This error was due to a missing </> in my render method.

like image 110
softdownfeathers Avatar answered Sep 21 '22 02:09

softdownfeathers