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

Uncaught SyntaxError: Unexpected token { #99

Open
piranna opened this issue Feb 27, 2019 · 4 comments
Open

Uncaught SyntaxError: Unexpected token { #99

piranna opened this issue Feb 27, 2019 · 4 comments

Comments

@piranna
Copy link

piranna commented Feb 27, 2019

With Chromium 71, trying to add support for react-native-dom to a project I get the error Uncaught SyntaxError: Unexpected token { in file bootstrap.bundle. Looking at the line, the code is provided by react-native-dom itself, seems the braced import statement is not supported by Chromium... Any clue about what could be happening and how can I be able to fix it?

  import { RNDomInstance } from "react-native-dom";
@peacechen
Copy link

This could be addressed by transpiling to ES5 using Webpack or Browserify. Projects consuming this may need to turn on the switch to transpile source under node_modules. That could slow down the build though.
Alternatively, react-native-dom could publish a minified & transpiled build.

@piranna
Copy link
Author

piranna commented Mar 28, 2019

Projects consuming this may need to turn on the switch to transpile source under node_modules.

What's that switch? I'm having this problem in another projects.

Alternatively, react-native-dom could publish a minified & transpiled build.

Yeah, that would be the ideal thing...

@peacechen
Copy link

Here's a walk-through for Webpack. There are tutorials out there for Bable and Browserify too.
https://medium.com/unhandled-exception/using-non-transpiled-modules-and-webpack-657dca27bd4a

@piranna
Copy link
Author

piranna commented Mar 28, 2019

Thank you! :-D

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