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

修改了ts,导致webpack一堆报错 #1

Closed
baixiaoji opened this issue Sep 15, 2018 · 7 comments
Closed

修改了ts,导致webpack一堆报错 #1

baixiaoji opened this issue Sep 15, 2018 · 7 comments

Comments

@baixiaoji
Copy link
Owner

Module build failed: Error: You may be using an old version of webpack; please check you're using at least version 4
    at successfulTypeScriptInstance (/Users/future/test-place/aaa/node_modules/ts-loader/dist/instances.js:155:15)
    at Object.getTypeScriptInstance (/Users/future/test-place/aaa/node_modules/ts-loader/dist/instances.js:51:12)
    at Object.loader (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:16:41)

 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.ts

@baixiaoji
Copy link
Owner Author

baixiaoji commented Sep 15, 2018

Module build failed: Error: You may be using an old version of webpack; please check you're using at least version 4 at successfulTypeScriptInstance (/Users/future/test-place/aaa/node_modules/ts-loader/dist/instances.js:155:15) at Object.getTypeScriptInstance (/Users/future/test-place/aaa/node_modules/ts-loader/dist/instances.js:51:12) at Object.loader (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:16:41) @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.ts

npm install webpack@4 -D

@baixiaoji
Copy link
Owner Author

Module build failed: TypeError: Cannot read property 'getEmitOutput' of null
    at Object.getEmitOutput (/Users/future/test-place/aaa/node_modules/ts-loader/dist/instances.js:190:40)
    at getEmit (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:198:37)
    at successLoader (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:34:11)
    at Object.loader (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:21:12)

 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.ts

@baixiaoji
Copy link
Owner Author

Module build failed: TypeError: Cannot read property 'getEmitOutput' of null at Object.getEmitOutput (/Users/future/test-place/aaa/node_modules/ts-loader/dist/instances.js:190:40) at getEmit (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:198:37) at successLoader (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:34:11) at Object.loader (/Users/future/test-place/aaa/node_modules/ts-loader/dist/index.js:21:12) @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.ts

npm i -D vue-loader@14

@baixiaoji
Copy link
Owner Author

module.js:471
    throw err;
    ^

Error: Cannot find module 'webpack/bin/config-yargs'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/future/test-place/aaa/node_modules/webpack-dev-server/bin/webpack-dev-server.js:54:1)
    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)

@baixiaoji
Copy link
Owner Author

baixiaoji commented Sep 15, 2018

module.js:471 throw err; ^ Error: Cannot find module 'webpack/bin/config-yargs' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object. (/Users/future/test-place/aaa/node_modules/webpack-dev-server/bin/webpack-dev-server.js:54:1) 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)

npm install webpack-cli@3 webpack-dev-server@3

mzgoddard/jest-webpack#27

@baixiaoji
Copy link
Owner Author

place/aaa/node_modules/events/events.js/Users/future/test-place/aaa/node_modules/html-webpack-plugin/lib/compiler.js:81
        var outputName = compilation.mainTemplate.applyPluginsWaterfall('asset-path', outputOptions.filename, {
                                                  ^

TypeError: compilation.mainTemplate.applyPluginsWaterfall is not a function
    at /Users/future/test-place/aaa/node_modules/html-webpack-plugin/lib/compiler.js:81:51
    at compile (/Users/future/test-place/aaa/node_modules/webpack/lib/Compiler.js:296:11)
    at hooks.afterCompile.callAsync.err (/Users/future/test-place/aaa/node_modules/webpack/lib/Compiler.js:553:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/future/test-place/aaa/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/future/test-place/aaa/node_modules/tapable/lib/Hook.js:154:20)

@baixiaoji
Copy link
Owner Author

place/aaa/node_modules/events/events.js/Users/future/test-place/aaa/node_modules/html-webpack-plugin/lib/compiler.js:81 var outputName = compilation.mainTemplate.applyPluginsWaterfall('asset-path', outputOptions.filename, { ^ TypeError: compilation.mainTemplate.applyPluginsWaterfall is not a function at /Users/future/test-place/aaa/node_modules/html-webpack-plugin/lib/compiler.js:81:51 at compile (/Users/future/test-place/aaa/node_modules/webpack/lib/Compiler.js:296:11) at hooks.afterCompile.callAsync.err (/Users/future/test-place/aaa/node_modules/webpack/lib/Compiler.js:553:14) at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/future/test-place/aaa/node_modules/tapable/lib/HookCodeFactory.js:32:10), :6:1) at AsyncSeriesHook.lazyCompileHook (/Users/future/test-place/aaa/node_modules/tapable/lib/Hook.js:154:20)

npm i -D html-webpack-plugin@3
jantimon/html-webpack-plugin#841

baixiaoji pushed a commit that referenced this issue Sep 15, 2018
@baixiaoji baixiaoji changed the title 修改了ts,但是webpack保存,提示修改为webpack@4 修改了ts,导致webpack一堆报错 Sep 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant