1

Trying to run facebook flux app as mentioned here . I have following tree structure for js application

│   .bundle.js
│   app.jsx
│   bundle.js
│
├───actions
│       TodoActions.jsx
│
├───components
│       Footer.jsx
│       Header.jsx
│       MainSection.jsx
│       TodoApp.jsx
│       TodoItem.jsx
│       TodoTextInput.jsx
│
├───constants
│       TodoConstants.jsx
│
├───dispatcher
│       AppDispatcher.jsx
│       Dispatcher.jsx
│
└───store
        TodoStore.jsx

In app.jsx code is like

 var React = require('react');
var TodoApp = require('./components/TodoApp');

    React.render(
      <TodoApp />,
      document.getElementById('todoapp')
    );

And in TodoApp.jsx I am exporting module as

module.exports = TodoApp;

When I am trying to make build.js it is making error as

Error: Cannot find module './components/TodoApp' from 'c:\www\example\react\flux\js'

Can't figure out where I am wrong ? Please let me know if I need to provide anything further on this

alwaysLearn
  • 6,882
  • 7
  • 39
  • 67

1 Answers1

1

After googling for some time I got the solution .Actual issue is require looks for the js extension but I have files with jsx .

Got my solution here

Community
  • 1
  • 1
alwaysLearn
  • 6,882
  • 7
  • 39
  • 67