question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I can't start server. Webpack2, babel-loader, Redux

See original GitHub issue

I am new in React and doing a Todo List but i can’t start my server because i am getting error when I try yarn run build

Error

ERROR in ./src/index.js Module parse failed: C:\Users\PixyDigital\Desktop\Getto\src\index.js Unexpected token (8:4) You may need an appropriate loader to handle this file type. | | render( | <Provider store={store}> | <App /> | </Provider>, @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/index.js webpack: Failed to compile.

index.js

import React from “react” import {render} from “react-dom” import {Provider} from “react-redux” import store from “./stores/store” import App from “./components/app.js”

render( <Provider store={store}> <App /> </Provider>, document.getElementById(“app”) )

webpack.config.js

module.exports = { entry: __dirname + “/src/index.js”, output:{ filename: “bundle.js”, path: __dirname + “/dist” }, module:{ loaders:[ { test:/.css$/, loader:“style-loader$css-loader” }, { test:/.jsx$/, loader:“babel-loader”, exclude:/node_modules/ } ] }, resolve:{ extensions:[‘*’,‘.js’,‘.jsx’,‘.css’] }, devServer:{ contentBase: __dirname + “/dist” } }

package.json

{ “name”: “todoApp”, “version”: “1.0.0”, “description”: “”, “main”: “index.js”, “license”: “MIT”, “scripts”: { “test”: “echo "Error: no test specified" && exit 1”, “build”: “webpack-dev-server --inline --hot” }, “devDependencies”: { “babel-core”: “^6.25.0”, “babel-loader”: “^7.1.1”, “babel-preset-es2015”: “^6.24.1”, “babel-preset-react”: “^6.24.1”, “css-loader”: “^0.28.4”, “style-loader”: “^0.18.2”, “webpack”: “^3.1.0”, “webpack-dev-server”: “^2.5.1” }, “dependencies”: { “react”: “^15.6.1”, “react-dom”: “^15.6.1”, “react-hot-loader”: “^1.3.1”, “react-redux”: “^5.0.5”, “redux”: “^3.7.1” } }

So have can I resolve my problem, Do you have any idea ? Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
laichuangchongcommented, Oct 22, 2017

@robksawyer

test: ‘/.js$/’

test: /.js$/,

0reactions
loganfsmythcommented, Sep 2, 2018

I’m triaging old issues on babel-loader. Since this has been inactive for ages, I’m going to close it. Feel free to re-open if there’s still something to discuss, but I’m assuming at this point it’s been too long to address in a useful way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebPack@5.38.1 with Babel-loader@8.2.2 error while ...
I am trying to set my development environment to start a project. at this point, I added webpack.config.dev.js file with some dependencies.
Read more >
Circular errors about babel-loader when trying to launch app
When I run yarn dev I get the error that: > ERROR in Entry module not found: Error: Can't resolve 'babel-loader' in.
Read more >
file-loader - webpack - JS.ORG
The file-loader resolves import / require() on a file into a url and emits the file into the output directory. Getting Started. To...
Read more >
The best webpack configurations for React applications
If you've struggled to configure webpack for your React app, look no further. We cover both generic and specific config needs.
Read more >
You Don't Need Create-React-App. Webpack ... - Sviat Kuzhelev
You Don't Need Create-React-App. Webpack 4 + React 16 + Redux 6 + Router 6 + Babel 7 + ... 2. We have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found