-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Lazy loading routes Error: Cyclic dependency #1669
Comments
To solve the problem I found a way out, add configuration to html-webpack-plugin // vue.config.js
module.exports = {
chainWebpack: config => {
config.plugin('html').tap(args => {
args[0].chunksSortMode = 'none'
return args
})
}
} |
This seems to be a problem with a dependency of the jantimon/html-webpack-plugin#981 Not much we can do about this... |
@LinusBorg may be set |
Works perfectly, but issue appears as well when launching tests ( |
What are you using for unit tests? |
Well, I'm using
|
That's what I wanted to know. That setup uses the same config, basically. it definitely adds the same custom configs of yours, but at the same time, it changes some internal configs to be suitable for mocha, but those don't touch the html plugin. Maybe removing the plugin completely when ``process.env.NODE_ENV === 'test'`? |
I don't know if It's feasible from EDIT: deleting |
hi, i have a error TypeError: Cannot set property 'chunksSortMode' of undefined , is there need me to config? |
@sueblue are you using the Run this to see what your plugins are named:
|
For those using Nuxt.js, this workaround solves the issue without installing new plugins nuxt.config.js // HtmlWebpackPlugin
const HtmlWebpackPlugin = config.plugins.find(plugin => {
return plugin.constructor.name === 'HtmlWebpackPlugin'
})
HtmlWebpackPlugin.options.chunksSortMode = 'none' |
@Akaryatrh could you expand a little bit more on how you got passed this issue? I have the exact same issue with mocha chai for testing which was setup with the vue CLI. This issue only happens when testing and it only happens when some of my components are imported and used but not all of them. |
for me helps installing of "html-webpack-plugin": "4.0.0-alpha.1" version |
…advanced/lazy-loading.html 2. change webpack config to workaround vuejs/vue-cli#1669. Can remove after update vue-cli to future release 3. move Landing screen login to main.js 4. add loading indicator and error handling for async route
I happened to get this error around toposort as well.
Running npx vue-cli-service inspect --plugins shows 'html' in the list but then when running a build and in my chain console logging plugins I get:
It looks like it is a dependency of fork-ts-checker in this case? |
@owlyowl did you find a solution to this? I'm trying to bundle a bunch of Vue components into a library and running into this exact issue. I've tried several things but considering using another tool like Rollup to bundle it manually. Keen to get your insights. Cheers! |
Version
3.0.0-rc.3
Reproduction link
https://github.com/antonreshetov/vue-cli-3-error-reproduction
Steps to reproduce
Create http service to which the router is imported
Connect http service to more than one component
Use lazy loading of components in the router
What is expected?
Compile without errors, as it was before
What is actually happening?
The text was updated successfully, but these errors were encountered: