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

cannot compile with grunt webpack-dev-server #116

Closed
adubois-stingray opened this issue Jan 25, 2017 · 7 comments
Closed

cannot compile with grunt webpack-dev-server #116

adubois-stingray opened this issue Jan 25, 2017 · 7 comments

Comments

@adubois-stingray
Copy link

I'm getting the following error after upgrading to webpack v2.2.0:

Running "webpack-dev-server:start" (webpack-dev-server) task
Verifying property webpack-dev-server.start exists in config...OK
File: [no files]
webpack-dev-server on port 3000
Fatal error: Cannot read property 'length' of undefined

version
webpack 2.2.0
grunt-webpack 2.0.0-beta.6
grunt 1.0.1
node 6.9.4
os win10

Please note that I'm able to run "grunt webpack --verbose" without error using same config.
Also, if I compile with npm "start": "webpack-dev-server --config ./config/webpack.dev.js", I have no error using the same config

Could you help me please ?

@nwoltman
Copy link

Could you run grunt webpack-dev-server:start --stack and then provide the stack trace from the error? Also, providing your configuration (or a minimal configuration that can reproduce the issue) would be very helpful for debugging.

@pratik-js
Copy link

pratik-js commented Jan 27, 2017

I am facing same issue.

ui>grunt webpack-dev-server:start --stack
Running "webpack-dev-server:start" (webpack-dev-server) task
Warning: arguments[i].apply is not a function Use --force to continue.
TypeError: arguments[i].apply is not a function
at Compiler.apply (F:\git_green\ui\node_modules\tapable\lib\Tapable.js:306:16)
at webpack (F:\git_green\ui\node_modules\webpack\lib\webpack.js:32:19)
at Object.webpackDevServerTask (F:\git_green\ui\node_modules\grunt-webpack\tasks\webpack-dev-server.js:62:22)
at Object. (F:\git_green\ui\node_modules\grunt\lib\grunt\task.js:255:15)
at Object.thisTask.fn (F:\git_green\ui\node_modules\grunt\lib\grunt\task.js:73:16)
at Object.fn (F:\git_green\ui\node_modules\jit-grunt\lib\jit-grunt.js:126:30)
at Object. (F:\git_green\ui\node_modules\grunt\lib\util\task.js:294:30)
at Task.runTaskFn (F:\git_green\ui\node_modules\grunt\lib\util\task.js:244:24)
at Task. (F:\git_green\ui\node_modules\grunt\lib\util\task.js:293:12)
at Task.start (F:\git_green\ui\node_modules\grunt\lib\util\task.js:302:5)
at Object.grunt.tasks (F:\git_green\ui\node_modules\grunt\lib\grunt.js:155:8)
at Object.module.exports [as cli] (F:\git_green\ui\node_modules\grunt\lib\grunt\cli.js:27:9)
at Object. (C:\Users\pratik.patel\AppData\Roaming\npm\node_modules\grunt-cli\bin\grunt:44:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3

@danez
Copy link
Collaborator

danez commented Jan 27, 2017

Fixed by #117

@adubois-stingray
Copy link
Author

I don't think it's the same bug, I've tried the fix in #117 , but I still have the same problem

Here the call stack :

C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk>grunt webpack-dev-server:start --stack
Running "webpack-dev-server:start" (webpack-dev-server) task
webpack-dev-server on port 3000
Fatal error: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at getPaths (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\getPaths.js:30:20)
at Resolver. (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\ModulesInHierachicDirectoriesPlugin.js:23:15)
at Resolver.applyPluginsParallelBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:288:14)
at beforeInnerCallback (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:112:19)
at loggingCallbackWrapper (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)
at Resolver.applyPluginsAsyncSeriesBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:181:46)
at Resolver.doResolve (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:100:11)
at Resolver. (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\TryNextPlugin.js:18:12)
at Resolver.applyPluginsParallelBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:288:14)
at beforeInnerCallback (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:112:19)
at loggingCallbackWrapper (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)
at Resolver.applyPluginsAsyncSeriesBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:181:46)
at Resolver.doResolve (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:100:11)
at Resolver. (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\ModuleKindPlugin.js:20:12)
at Resolver.applyPluginsAsyncSeriesBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:192:13)
at innerCallback (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:125:19)
at loggingCallbackWrapper (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)
at C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:283:15
at Resolver. (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\ConcordModulesPlugin.js:25:28)
at Resolver.applyPluginsParallelBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:288:14)
at beforeInnerCallback (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:112:19)
at loggingCallbackWrapper (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19)
at Resolver.applyPluginsAsyncSeriesBailResult1 (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\tapable\lib\Tapable.js:181:46)
at Resolver.doResolve (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\Resolver.js:100:11)
at C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:40:13
at C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\DescriptionFileUtils.js:49:12
at C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\forEachBail.js:29:14
at onJson (C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\DescriptionFileUtils.js:40:5)
at C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\DescriptionFileUtils.js:18:6
at C:\dev\Projects\HTML5\StingrayMusicWebPlayer\trunk\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:62:14
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

I also added a log in node_modules/enhanced-resolve/lib/getPaths.js to see what's the incorrect path, I have this logs:

Running "webpack-dev-server:start" (webpack-dev-server) task
webpack-dev-server on port 3000
path: ./src/polyfills.ts
path: ./src/polyfills.ts*
path: ./src/polyfills.ts.ts
path: ./src/polyfills.ts.js
path: ./src/vendor.ts
path: ./src/vendor.ts*
path: ./src/vendor.ts.ts
path: ./src/vendor.ts.js
path: ./src/app/main.ts
path: ./src/app/main.ts*
path: ./src/app/main.ts.ts
path: ./src/app/main.ts.js
path: ./src/app/init.ts
path: ./src/app/init.ts*
path: ./src/app/init.ts.ts
path: ./src/app/init.ts.js
path: .
Fatal error: Cannot read property 'length' of undefined

I also attached my config files

configs.zip

@danez
Copy link
Collaborator

danez commented Jan 27, 2017

Can you try removing the default options?

516a02b

@danez danez reopened this Jan 27, 2017
@adubois-stingray
Copy link
Author

If if do the change of 516a02b, everythings look good, thanks :)

@danez
Copy link
Collaborator

danez commented Jan 27, 2017

Okay I released 2.0.1 with this fix. Thanks for reporting.

@danez danez closed this as completed Jan 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants