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

Brace problem with Babel... #64

Closed
DWboutin opened this issue Nov 2, 2015 · 4 comments
Closed

Brace problem with Babel... #64

DWboutin opened this issue Nov 2, 2015 · 4 comments

Comments

@DWboutin
Copy link

DWboutin commented Nov 2, 2015

thlorenz/brace#40 (comment)

@DWboutin DWboutin changed the title Brace problem with Browserify... Brace problem with Babel... Nov 2, 2015
@stevehu
Copy link

stevehu commented Nov 7, 2015

A similar problem in Brace I just opened.

thlorenz/brace#42

@spoike
Copy link

spoike commented Dec 7, 2015

I'm using babel-register and I ended up doing two things:

  • importing a file (./.../Editor.js) that has an empty div
  • In my browserify build, setting the browser field in package.json to the file that actually uses ReactAce (./.../Editor-browser.js). it defers the render with React Ace by using a state variable that is set during componentDidMount (with a setTimeout), so that the client-side and server-side renders don't differ, but renders ReactAce after the mount.

@stevehu
Copy link

stevehu commented Dec 8, 2015

@spoike I don't have any server side rendering at all. I end up have my own fixed version and install from github.

@spoike
Copy link

spoike commented Dec 8, 2015

@stevehu I'm referring to the error @DWboutin had, which was exact with mine where I was rendering react-ace on server-side. There is no clear explanation on how to work around the problem that brace and react-ace has a direct reference to the window object. Thus my comment to pull out the editor in node environment completely and render it instead client-side only when the component was mounted.

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

4 participants