Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Basics (retired) Thinking in Components PropTypes and DefaultProps

Michal Janek
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Michal Janek
Front End Web Development Techdegree Graduate 30,654 Points

Anyone else experiencing require not defined issue?

I am working with WebStorm editor and found out we are not supposed to do these things in browser since require is defined in Node.js when handling server in back-end, not in client browser part.
I have read about browserify, requirejs packages but this is getting a bit overwhelming.

Anyone willing to shed some light?

Also ...I am troubleshooting a lot of issues trying to do this in my own IDE, maybe because of lack of skills. Usually it was easy to switch from Treehouse workspaces into our own editors but this is proving to be a messy operation.

1 Answer

Rich Zimmerman
Rich Zimmerman
24,063 Points

In workspaces, you're effectively logging into a server and running the console and a built in IDE on the server you're logged in to. If you're using your own IDE, you're running it on your local machine (your pc). I'm not familiar with WebStorm but i know a lot of IDEs have a console built in, you would just have to install nodejs on your local machine and run the console in your IDE, or from your command prompt.

It may take some troubleshooting to set up which is why workspaces are so convenient while you're learning the coding side of the industry... the troubleshooting is a headache that comes later. =)

Michal Janek
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Michal Janek
Front End Web Development Techdegree Graduate 30,654 Points

My philosophy was that without a proper setup (cannot really use workspace environment in Real life) there is not much point in learning the coding side. Since even if I get it on workspaces - that will not be a real life scenario anymore. Thank you will try to do it the other way around.

Even though I just killed 5 hours of focused energy and learned nothing about react...learned a bunch about npm, packaging and modules...unexpected.

Rich Zimmerman
Rich Zimmerman
24,063 Points

Yeah i experienced the same thing when i tried to write my first node app in the real world. The biggest thing is to realize that workspaces is its own environment with its own software installed, so when you want to do the same thing outside of workspaces, you need to make sure the proper software is installed.