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

Issue on dev-server-client build #9

Open
dfcarpenter opened this issue Jul 14, 2015 · 7 comments
Open

Issue on dev-server-client build #9

dfcarpenter opened this issue Jul 14, 2015 · 7 comments

Comments

@dfcarpenter
Copy link

Trying to figure out what is going wrong but keep getting an error on webpack build

 ERROR in ./app/routes.js
    Module build failed: Error: /Users/dan/Stringify/web-react/node_modules/eslint-loader/index.js!/Users/dan/Stringify/web-react/app/routes.js: Invalid mapping: {"generated":{"line":39,"column":21},"source":"/Users/dan/Stringify/web-react/node_modules/eslint-loader/index.js!/Users/dan/Stringify/web-react/app/routes.js","name":null}
@darul75
Copy link
Owner

darul75 commented Jul 14, 2015

Weird, I can not figure out what is going on, so you can avoid it by including this at beginning and end:

Try into routes.js

/*eslint-disable*/
...code
/*eslint-enable*/

but it does not fix the problem, just escape some eslint checks.

can you share your routes.js

@dfcarpenter
Copy link
Author

// LIBRARY
/*eslint-disable no-unused-vars*/
import React from 'react';
/*eslint-enable no-unused-vars*/
import {Route, DefaultRoute, NotFoundRoute} from 'react-router';

// COMPONENT
import Application from './components/App/App';
import Contact from './components/ContactSection/Contact';
import HomeSection from './components/HomeSection/HomeSection';
import NotFoundSection from './components/NotFoundSection/NotFoundSection';
import TodoSection from './components/TodoSection/TodoSection';

export default (
  <Route name='app' path='/' handler={Application}>
    <Route name='home' path='/home' handler={HomeSection}/>
    <Route name='todo' path='/todo' handler={TodoSection}/>
    <Route name='contact' path="/contact" handler={Contact}/>
    <DefaultRoute handler={HomeSection} />
    <NotFoundRoute handler={NotFoundSection} />
  </Route>
);

@darul75
Copy link
Owner

darul75 commented Jul 14, 2015

hmm difficult, I have removed my node_modules folder, fetch modules again and I can not reproduce, looks like it is caused by sourcemap somewhere.

@dfcarpenter
Copy link
Author

Found the problem

http://stackoverflow.com/questions/30983668/invalid-mapping-error-trying-to-use-babel-require-hook-and-polyfill-with-react

Tried latest version of acorn but that didn't work either so I had to explicitly put 1.0.3 for acorn jsx version in the package.json for babel-core and rm -rf node_modules/acorn-jsx && npm install in the node_modules/babel-core directory

@darul75
Copy link
Owner

darul75 commented Jul 16, 2015

nice catch, what do you think I could do to resolve it ?

another question, does this project fits well your need, what should be improved ?

thx

@dfcarpenter
Copy link
Author

  1. Since the build process works for you, I would try updating your babel-loader to the latest version and checking to see which version of acorn-jsx/acorn the babel-core dependency is using (Should be 2.0.4, I think). If it works for you then I would just update the package.json. Otherwise keep it the same and just add a caveat to readme.

2.I'm using this project as a test case by building an analytics app which queries elastic search. I am using a form in react to query elasticsearch (with an interface to elasticsearch as part of an api node exposes) and integrating d3 into the react components and displaying them on the screen. Once this works, I am looking into switching another app (our main front end app) from angular-es6/with jspm to isomorphic react/alt/immutable for performance gains. Mostly I am interested in the performance benefits of the isomorphic approach along with the developer ergonomics and maintainability of react along with a better understanding of the trend towards and benefits of immutable data types.

@darul75
Copy link
Owner

darul75 commented Jul 23, 2015

hi @dfcarpenter

thank your for these details, I will update dependencies asap

to my mind flux approach combined with immutable data types avoid bad side effect.

some good reasons explained here by instance :

https://scott.mn/2014/04/27/why_immutable_collections/

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