Struggling with Meteor and ES6

Hello folks, I’m trying to follow this guide: http://guide.meteor.com/v1.3/react.html#introduction but when I try to run my app I get this error:

W20160319-22:47:30.734(1)? (STDERR)
W20160319-22:47:30.735(1)? (STDERR) /Users/rubs/.meteor/packages/meteor-tool/.1.1.13-beta.12.1ij6n98++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:267
W20160319-22:47:30.735(1)? (STDERR) throw(ex);
W20160319-22:47:30.735(1)? (STDERR) ^
W20160319-22:47:30.738(1)? (STDERR) ReferenceError: document is not defined
W20160319-22:47:30.738(1)? (STDERR) at start.jsx:7:25
W20160319-22:47:30.738(1)? (STDERR) at /Users/rubs/Documents/Desarrollo/meteorjs/reacte6/.meteor/local/build/programs/server/boot.js:252:5

The file start.jsx has this code:

`import React from 'react’
import { Meteor } from ‘meteor/meteor’;
import { render } from ‘react-dom’;
import HelloWorld from ‘./test.jsx’;

Meteor.startup(() => {
render(< HelloWorld />, document.getElementById(‘app’));
});`

Any help is appreciated.

Sounds like you’ve got code that is meant to run on the client running on the server as well. “document is not defined”. Just put client code in client/ and server code in server/ and that error will likely disappear.

EDIT: The guide seems to assume you’re already familiar with where to put what, so it doesn’t specifically say which code should go where. It seems wise to add something there that directs newbies to some information about client/ and server/ folders and structuring your app.

1 Like

Thank you seeker going to check that folder structure right now, just came back to meteor after some time and probably I should pick something more basic in order to remember how this works.