Skip to content
This repository has been archived by the owner on Jun 9, 2019. It is now read-only.

Bad compilation #50

Open
jakehamilton opened this issue Feb 11, 2017 · 3 comments
Open

Bad compilation #50

jakehamilton opened this issue Feb 11, 2017 · 3 comments

Comments

@jakehamilton
Copy link

I've dug at it for the past hour, looks like it's a dependency issue?

Steps to reproduce:

# Install vue-cli
npm install -g vue-cli

# Start new project
vue-cli init webpack .

# Install packages
npm install && npm install --save-dev vue-play vue-play-cli

Then create ./play/index.js with these contents:

import { play } from 'vue-play'

play('Test')
  .add('default', '<button>hi</button>')

Then try each of these:

# attempt 1
vue-play start

# attempt 2
vue-play start --webpack-config ./build/webpack.dev.conf.js

Error is:

 ERROR  Failed to compile with 9 errors

These dependencies were not found in node_modules:

* /Users/jakehamilton/work/tumble/node_modules/vue-play-cli/lib/entries/app.js
* ./src/main.js
* /Users/jakehamilton/work/tumble/node_modules/vue-play-cli/lib/entries/preview.js
* /Users/jakehamilton/work/tumble/node_modules/webpack-hot-middleware/client.js?reload=true
* eventsource-polyfill
* ./../vue-play-cli/node_modules/webpack/buildin/module.js
* ./lib/xml-entities.js
* ./lib/html4-entities.js
* ./lib/html5-entities.js

Did you forget to run npm install --save for them?
webpack built 81e5a44f3f243248236b in 3226ms
Hash: 81e5a44f3f243248236b
Version: webpack 1.14.0
Time: 3226ms
     Asset     Size  Chunks       Chunk Names
    app.js   112 kB       0       app
preview.js  46.7 kB       1       preview

ERROR in multi app
Module not found: Error: Cannot resolve 'file' or 'directory' /Users/jakehamilton/work/tumble/node_modules/vue-play-cli/lib/entries/app.js in /Users/jakehamilton/work/tumble
 @ multi app

ERROR in multi app
Module not found: Error: Cannot resolve 'file' or 'directory' ./src/main.js in /Users/jakehamilton/work/tumble
 @ multi app

ERROR in multi preview
Module not found: Error: Cannot resolve 'file' or 'directory' /Users/jakehamilton/work/tumble/node_modules/vue-play-cli/lib/entries/preview.js in /Users/jakehamilton/work/tumble
 @ multi preview

ERROR in multi preview
Module not found: Error: Cannot resolve 'file' or 'directory' /Users/jakehamilton/work/tumble/node_modules/webpack-hot-middleware/client.js in /Users/jakehamilton/work/tumble
 @ multi preview

ERROR in   TypeError: Cannot read property '0' of undefined
  
  - ExternalModuleFactoryPlugin.js:18 ExternalModuleFactoryPlugin.<anonymous>
    [tumble]/[webpack]/lib/ExternalModuleFactoryPlugin.js:18:38
  
  - NormalModuleFactory.js:159 
    [tumble]/[vue-play-cli]/[webpack]/lib/NormalModuleFactory.js:159:3
  
  - Tapable.js:75 NormalModuleFactory.applyPluginsAsyncWaterfall
    [tumble]/[vue-play-cli]/[tapable]/lib/Tapable.js:75:69
  
  - NormalModuleFactory.js:144 NormalModuleFactory.create
    [tumble]/[vue-play-cli]/[webpack]/lib/NormalModuleFactory.js:144:8
  
  - Compilation.js:356 Compilation.process [as _addModuleChain]
    [tumble]/[vue-play-cli]/[webpack]/lib/Compilation.js:356:16
  
  - Compilation.js:424 Compilation.process [as addEntry]
    [tumble]/[vue-play-cli]/[webpack]/lib/Compilation.js:424:7
  
  - SingleEntryPlugin.js:24 Compiler.compiler.plugin
    [tumble]/[webpack]/lib/SingleEntryPlugin.js:24:16
  
  - Tapable.js:107 Compiler.applyPluginsParallel
    [tumble]/[vue-play-cli]/[tapable]/lib/Tapable.js:107:14
  
  - Compiler.js:394 Compiler.compile
    [tumble]/[vue-play-cli]/[webpack]/lib/Compiler.js:394:7
  
  - Compiler.js:203 Compiler.runAsChild
    [tumble]/[vue-play-cli]/[webpack]/lib/Compiler.js:203:7
  
  - compiler.js:70 
    [tumble]/[html-webpack-plugin]/lib/compiler.js:70:19
  
  - debuggability.js:300 Promise._execute
    [tumble]/[bluebird]/js/release/debuggability.js:300:9
  
  - promise.js:481 Promise._resolveFromExecutor
    [tumble]/[bluebird]/js/release/promise.js:481:18
  
  - promise.js:77 new Promise
    [tumble]/[bluebird]/js/release/promise.js:77:14
  
  - compiler.js:69 Object.compileTemplate
    [tumble]/[html-webpack-plugin]/lib/compiler.js:69:10
  
  - index.js:47 Compiler.<anonymous>
    [tumble]/[html-webpack-plugin]/index.js:47:40
  


ERROR in   TypeError: Cannot read property '0' of undefined
  
  - ExternalModuleFactoryPlugin.js:18 ExternalModuleFactoryPlugin.<anonymous>
    [tumble]/[webpack]/lib/ExternalModuleFactoryPlugin.js:18:38
  
  - NormalModuleFactory.js:159 
    [tumble]/[vue-play-cli]/[webpack]/lib/NormalModuleFactory.js:159:3
  
  - Tapable.js:75 NormalModuleFactory.applyPluginsAsyncWaterfall
    [tumble]/[vue-play-cli]/[tapable]/lib/Tapable.js:75:69
  
  - NormalModuleFactory.js:144 NormalModuleFactory.create
    [tumble]/[vue-play-cli]/[webpack]/lib/NormalModuleFactory.js:144:8
  
  - Compilation.js:356 Compilation.process [as _addModuleChain]
    [tumble]/[vue-play-cli]/[webpack]/lib/Compilation.js:356:16
  
  - Compilation.js:424 Compilation.process [as addEntry]
    [tumble]/[vue-play-cli]/[webpack]/lib/Compilation.js:424:7
  
  - SingleEntryPlugin.js:24 Compiler.compiler.plugin
    [tumble]/[webpack]/lib/SingleEntryPlugin.js:24:16
  
  - Tapable.js:107 Compiler.applyPluginsParallel
    [tumble]/[vue-play-cli]/[tapable]/lib/Tapable.js:107:14
  
  - Compiler.js:394 Compiler.compile
    [tumble]/[vue-play-cli]/[webpack]/lib/Compiler.js:394:7
  
  - Compiler.js:203 Compiler.runAsChild
    [tumble]/[vue-play-cli]/[webpack]/lib/Compiler.js:203:7
  
  - compiler.js:70 
    [tumble]/[html-webpack-plugin]/lib/compiler.js:70:19
  
  - debuggability.js:300 Promise._execute
    [tumble]/[bluebird]/js/release/debuggability.js:300:9
  
  - promise.js:481 Promise._resolveFromExecutor
    [tumble]/[bluebird]/js/release/promise.js:481:18
  
  - promise.js:77 new Promise
    [tumble]/[bluebird]/js/release/promise.js:77:14
  
  - compiler.js:69 Object.compileTemplate
    [tumble]/[html-webpack-plugin]/lib/compiler.js:69:10
  
  - index.js:47 Compiler.<anonymous>
    [tumble]/[html-webpack-plugin]/index.js:47:40
  


ERROR in   TypeError: Cannot read property '0' of undefined
  
  - ExternalModuleFactoryPlugin.js:18 ExternalModuleFactoryPlugin.<anonymous>
    [tumble]/[webpack]/lib/ExternalModuleFactoryPlugin.js:18:38
  
  - NormalModuleFactory.js:159 
    [tumble]/[vue-play-cli]/[webpack]/lib/NormalModuleFactory.js:159:3
  
  - Tapable.js:75 NormalModuleFactory.applyPluginsAsyncWaterfall
    [tumble]/[vue-play-cli]/[tapable]/lib/Tapable.js:75:69
  
  - NormalModuleFactory.js:144 NormalModuleFactory.create
    [tumble]/[vue-play-cli]/[webpack]/lib/NormalModuleFactory.js:144:8
  
  - Compilation.js:356 Compilation.process [as _addModuleChain]
    [tumble]/[vue-play-cli]/[webpack]/lib/Compilation.js:356:16
  
  - Compilation.js:424 Compilation.process [as addEntry]
    [tumble]/[vue-play-cli]/[webpack]/lib/Compilation.js:424:7
  
  - SingleEntryPlugin.js:24 Compiler.compiler.plugin
    [tumble]/[webpack]/lib/SingleEntryPlugin.js:24:16
  
  - Tapable.js:107 Compiler.applyPluginsParallel
    [tumble]/[vue-play-cli]/[tapable]/lib/Tapable.js:107:14
  
  - Compiler.js:394 Compiler.compile
    [tumble]/[vue-play-cli]/[webpack]/lib/Compiler.js:394:7
  
  - Compiler.js:203 Compiler.runAsChild
    [tumble]/[vue-play-cli]/[webpack]/lib/Compiler.js:203:7
  
  - compiler.js:70 
    [tumble]/[html-webpack-plugin]/lib/compiler.js:70:19
  
  - debuggability.js:300 Promise._execute
    [tumble]/[bluebird]/js/release/debuggability.js:300:9
  
  - promise.js:481 Promise._resolveFromExecutor
    [tumble]/[bluebird]/js/release/promise.js:481:18
  
  - promise.js:77 new Promise
    [tumble]/[bluebird]/js/release/promise.js:77:14
  
  - compiler.js:69 Object.compileTemplate
    [tumble]/[html-webpack-plugin]/lib/compiler.js:69:10
  
  - index.js:47 Compiler.<anonymous>
    [tumble]/[html-webpack-plugin]/index.js:47:40
  


ERROR in ./build/dev-client.js
Module not found: Error: Cannot resolve module 'eventsource-polyfill' in /Users/jakehamilton/work/tumble/build
 @ ./build/dev-client.js 4:0-31

ERROR in ./~/webpack-hot-middleware/client.js?noInfo=true&reload=true
Module not found: Error: Cannot resolve 'file' or 'directory' ./../vue-play-cli/node_modules/webpack/buildin/module.js in /Users/jakehamilton/work/tumble/node_modules/webpack-hot-middleware
 @ ./~/webpack-hot-middleware/client.js?noInfo=true&reload=true 1:0-67

ERROR in ./~/html-entities/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./lib/xml-entities.js in /Users/jakehamilton/work/tumble/node_modules/html-entities
 @ ./~/html-entities/index.js 2:15-47

ERROR in ./~/html-entities/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./lib/html4-entities.js in /Users/jakehamilton/work/tumble/node_modules/html-entities
 @ ./~/html-entities/index.js 3:17-51

ERROR in ./~/html-entities/index.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./lib/html5-entities.js in /Users/jakehamilton/work/tumble/node_modules/html-entities
 @ ./~/html-entities/index.js 4:17-51 5:19-53
webpack: Failed to compile.

Compiled successfully!

Vue Play is running at http://localhost:5000
@csonlai
Copy link

csonlai commented Mar 20, 2017

ERROR in TypeError: Cannot read property '0' of undefined
met the same problem, using webpack2

@egoist
Copy link
Collaborator

egoist commented Mar 20, 2017

@csonlai can you provide a repo to reproduce?

@csonlai
Copy link

csonlai commented Mar 20, 2017

ExternalModuleFactoryPlugin.js:
normalModuleFactory.plugin("factory", function(factory) {
return function(data, callback) {
var context = data.context;
var dependency = data.dependency; // it is data.dependency[0] in webpack2 and cause error

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