harsima / vue-backend

简单的后台管理框架
MIT License
883 stars 347 forks source link

need help about 'Cyclic dependency' #29

Closed yanhj93 closed 5 years ago

yanhj93 commented 5 years ago

when i import staticRoute from '../../router/staticRoute' in a vue file, error reported like this:

i 「wdm」: wait until bundle finished: C:\Users\libre\projects\xxx\node_modules\toposort\index.js:35 throw new Error('Cyclic dependency' + nodeRep) ^

Error: Cyclic dependency at visit (C:\Users\libre\projects\xxx\node_modules\toposort\index.js:35:13) at visit (C:\Users\libre\projects\xxx\node_modules\toposort\index.js:53:9) at visit (C:\Users\libre\projects\xxx\node_modules\toposort\index.js:53:9) at Function.toposort [as array] (C:\Users\libre\projects\xxx\node_modules\toposort\index.js:22:22) at Object.module.exports.dependency (C:\Users\libre\projects\xxx\node_modules\html-webpack-plugin\lib\chunksorter.js:50:35) at HtmlWebpackPlugin.sortChunks (C:\Users\libre\projects\xxx\node_modules\html-webpack-plugin\index.js:364:35) at C:\Users\libre\projects\xxx\node_modules\html-webpack-plugin\index.js:113:21 at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\libre\projects\xxx\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:24:12), :7:1) at AsyncSeriesHook.lazyCompileHook [as _callAsync] (C:\Users\libre\projects\xxx\node_modules\webpack\node_modules\tapable\lib\Hook.js:35:21) at Compiler.emitAssets (C:\Users\libre\projects\xxx\node_modules\webpack\lib\Compiler.js:307:19) at onCompiled (C:\Users\libre\projects\xxx\node_modules\webpack\lib\Watching.js:50:19) at hooks.afterCompile.callAsync.err (C:\Users\libre\projects\xxx\node_modules\webpack\lib\Compiler.js:487:14) at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\libre\projects\xxx\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:24:12), :15:1) at AsyncSeriesHook.lazyCompileHook [as _callAsync] (C:\Users\libre\projects\xxx\node_modules\webpack\node_modules\tapable\lib\Hook.js:35:21) at compilation.seal.err (C:\Users\libre\projects\xxx\node_modules\webpack\lib\Compiler.js:484:30) at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\Users\libre\projects\xxx\node_modules\webpack\node_modules\tapable\lib\HookCodeFactory.js:24:12), :6:1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! enn-ish@1.2.0 dev: node build/dev-server.js npm ERR! Exit status 1

谢谢

yanhj93 commented 5 years ago

https://github.com/marcelklehr/toposort/issues/20#issue-262085559