lawsumisu / ygo-card-designer

0 stars 1 forks source link

Module build failed: SyntaxError: Unexpected token #17

Closed BeyondTheHorizon closed 6 years ago

BeyondTheHorizon commented 6 years ago

Hi, this looks like an interesting program, however I'm having problems starting it up. When I run "npm start", it exits with the following error:

ERROR in multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev
-server react-hot-loader/patch webpack-dev-server/client?http://localhost:8080 w
ebpack/hot/only-dev-server ./main.js                                            
Module not found: Error: Can't resolve '\ygo-card-designer\node_modules\webpack-
dev-server\client\index.js?http://localhost:8080' in 'J:\Robert's Folder\Yu-Gi-O
h!\ygo-card-designer\client'                                                    
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r react-hot-loader/patch webpack-dev-server/client?http://localhost:8080 webpack
/hot/only-dev-server ./main.js                                                  

ERROR in ./client/main.js                                                       
Module build failed: SyntaxError: Unexpected token (13:4)                       

  11 | const render = (Component) => {                                          
  12 |   ReactDOM.render(                                                       
> 13 |     <AppContainer>                                                       
     |     ^                                                                    
  14 |       <Provider store={store}>                                           
  15 |         <Component/>                                                     
  16 |       </Provider>                                                        

 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r react-hot-loader/patch webpack-dev-server/client?http://localhost:8080 webpack
/hot/only-dev-server ./main.js                                                  
webpack: Failed to compile.
BeyondTheHorizon commented 6 years ago

A month later, I still can't run it. Same error.

lawsumisu commented 6 years ago

Hey, sorry for the late notice on this. Let me investigate and get back to you.

lawsumisu commented 6 years ago

I see that I was missing some packages; I've added them and updated master. Can you check now to see if you get the same error?

BeyondTheHorizon commented 6 years ago

Sorry, I still get the same error.

lawsumisu commented 6 years ago

What version of Node/NPM do you have?

BeyondTheHorizon commented 6 years ago

I have 8.11.2.

lawsumisu commented 6 years ago

Okay, can you paste here the results of npm ls --depth=0 as well as tell me what OS you are building this app on?

BeyondTheHorizon commented 6 years ago

Ah, npm ls --depth=0 reports missing dependencies of packages installed by npm install.

+-- babel-core@6.26.3 +-- babel-loader@6.4.1 +-- babel-preset-es2015@6.24.1 +-- babel-preset-react@6.24.1 +-- css-loader@0.25.0 +-- dom-to-image@2.6.0 +-- extract-text-webpack-plugin@2.1.2 +-- file-loader@1.1.11 +-- file-saver@1.3.8 +-- gh-pages@1.2.0 +-- jquery@3.3.1 +-- less@2.7.3 +-- less-loader@2.2.3 +-- lodash@4.17.10 +-- node-sass@4.9.0 +-- prop-types@15.6.1 +-- react@15.6.2 +-- react-dom@15.6.2 +-- react-hot-loader@3.1.3 +-- react-redux@5.0.7 +-- redux@3.7.2 +-- reselect@3.0.1 +-- sass-loader@6.0.7 +-- sprintf-js@1.1.1 +-- style-loader@0.13.2 +-- url-loader@0.6.2 +-- webpack@2.7.0 +-- webpack-config-utils@2.3.0 -- webpack-dev-server@2.11.2

npm ERR! peer dep missing: ajv@^6.0.0, required by ajv-keywords@3.2.0 npm ERR! missing: mkdirp@0.5.1, required by node-pre-gyp@0.10.0 npm ERR! missing: minimist@0.0.8, required by mkdirp@0.5.1 npm ERR! missing: minimatch@3.0.4, required by ignore-walk@3.0.1 npm ERR! missing: brace-expansion@1.1.11, required by minimatch@3.0.4 npm ERR! missing: balanced-match@1.0.0, required by brace-expansion@1.1.11 npm ERR! missing: concat-map@0.0.1, required by brace-expansion@1.1.11 npm ERR! missing: console-control-strings@1.1.0, required by npmlog@4.1.2 npm ERR! missing: inherits@2.0.3, required by readable-stream@2.3.6 npm ERR! missing: safe-buffer@5.1.1, required by readable-stream@2.3.6 npm ERR! missing: safe-buffer@5.1.1, required by string_decoder@1.1.1 npm ERR! missing: console-control-strings@1.1.0, required by gauge@2.7.4 npm ERR! missing: string-width@1.0.2, required by gauge@2.7.4 npm ERR! missing: strip-ansi@3.0.1, required by gauge@2.7.4 npm ERR! missing: code-point-at@1.1.0, required by string-width@1.0.2 npm ERR! missing: is-fullwidth-code-point@1.0.0, required by string-width@1.0.2 npm ERR! missing: strip-ansi@3.0.1, required by string-width@1.0.2 npm ERR! missing: number-is-nan@1.0.1, required by is-fullwidth-code-point@1.0.0

npm ERR! missing: ansi-regex@2.1.1, required by strip-ansi@3.0.1 npm ERR! missing: string-width@1.0.2, required by wide-align@1.1.2 npm ERR! missing: inherits@2.0.3, required by glob@7.1.2 npm ERR! missing: minimatch@3.0.4, required by glob@7.1.2 npm ERR! missing: once@1.4.0, required by glob@7.1.2 npm ERR! missing: once@1.4.0, required by inflight@1.0.6 npm ERR! missing: wrappy@1.0.2, required by inflight@1.0.6 npm ERR! missing: wrappy@1.0.2, required by once@1.4.0 npm ERR! missing: minipass@2.2.4, required by tar@4.4.1 npm ERR! missing: mkdirp@0.5.1, required by tar@4.4.1 npm ERR! missing: safe-buffer@5.1.1, required by tar@4.4.1 npm ERR! missing: yallist@3.0.2, required by tar@4.4.1 npm ERR! missing: minipass@2.2.4, required by fs-minipass@1.2.5 npm ERR! missing: safe-buffer@5.1.1, required by minipass@2.2.4 npm ERR! missing: yallist@3.0.2, required by minipass@2.2.4 npm ERR! missing: minipass@2.2.4, required by minizlib@1.1.0

I'm also on Windows 8.1.

lawsumisu commented 6 years ago

Okay, your dependencies seem fine. What shell are you using to run this? I actually use Git Bash to run all my node commands, as I've had issues with both Cygwin and Bash on Windows.

BeyondTheHorizon commented 6 years ago

I was using ConEmu. I tried Git Bash but it didn't resolve the Module Build Failed error. Ugh!

lawsumisu commented 6 years ago

Sorry man; i'm not sure what's going on with this app. It might be another deadend, but have you looked at this? https://github.com/webpack/webpack-dev-server/issues/155

BeyondTheHorizon commented 6 years ago

HALLELUJAH! I FOUND THE PROBLEM AND IT WORKS NOW!

The problem was that I put the app in a directory called "Yu-Gi-Oh!", and according to dryoma on the page you linked, webpack doesn't recognise certain characters in directory paths, including exclamation marks. Once I moved it out of that directory, it works.

lawsumisu commented 6 years ago

Wow, well I'm glad things worked out for you. Closing this issue then.