Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.

Errors when running npm start #21

Open
chinds185a opened this issue Sep 10, 2016 · 3 comments
Open

Errors when running npm start #21

chinds185a opened this issue Sep 10, 2016 · 3 comments

Comments

@chinds185a
Copy link

Hi, I have run through the npm install which succeeded then when I ran npm start i was presented with the error see in the attached image. The server did start but the browser console also complains that it cannot find ./client/main.jsx

I am running node 6.5 and npm 3.10.3

screen shot 2016-09-10 at 12 25 52

Chrome console error:

screen shot 2016-09-10 at 12 29 32

@jbultmann
Copy link

jbultmann commented Oct 19, 2016

Hi,

i encountered the same problem.
I figured that the precompiling was not able to recognize the JSX Syntax.
To fix this i explicitly defined all the babel plugins specified in the package.json inside the webpack loader.

In webpack.config.development.js change

config.module.loaders = config.module.loaders.concat([
  {test: /\.jsx?$/, loaders: [ 'react-hot', 'babel'], exclude: /node_modules/}
]);

to

config.module.loaders = config.module.loaders.concat([
  {
      test: /\.jsx?$/,
      loaders: [ 'react-hot', 'babel?presets[]=es2015&presets[]=react&presets[]=stage-0'],
      exclude: /node_modules/
  }
]);

same in webpack.config.production.js just without the hotloading.

config.module.loaders = config.module.loaders.concat([
  {test: /\.jsx?$/, loaders: [ 'babel'], exclude: /node_modules/}
]);

to

config.module.loaders = config.module.loaders.concat([
  {
      test: /\.jsx?$/,
      loaders: [ 'babel?presets[]=es2015&presets[]=react&presets[]=stage-0'],
      exclude: /node_modules/
  }
]);

I am not sure if babel will use a .babelrc file with webpack as I never tested it.
If so this could also be resolved with a single .babelrc

{
   "plugins": ["es-2015", "react", "stage-0"]
}

EDIT:
Just tested the .babelrc Version. It Works and is IMO the cleaner method

@elliotrock
Copy link

@jbultmann What was the setup for the .babelrc version? Thanks

@elliotrock
Copy link

Seems too many errors to make this a usable boiler-plate next!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants