dependency cycle detected import/no-cycle

This could be a direct reference (A -> B -> A) issue, which even you might be doing.

// file a.ts
import { b } from 'b';
...
export a;

// file b.ts
import { a } from 'a';
...
export b;

Read HERE more about “Eliminate Circular Dependencies from Your JavaScript Project”:

Once I had the issue in vue.js project and the code that had issue was something like this:

<script>
  import router from '@/router';
  import { requestSignOut } from '../../api/api';

  export default {
    name: 'sign-out',
    mounted() {
      requestSignOut().then((data) => {
        if (data.status === 'ok') {
          router.push({ name: 'sign-in' });
        }
      });
    },
  };
</script>

Then I fixed it this way:

<script>
import { requestSignOut } from '@/api/api';

export default {
  name: 'sign-out',
  mounted() {
    requestSignOut().then((data) => {
      if (data.status === 'ok') {
        this.$router.push({ name: 'sign-in' });
      }
    });
  },
};
</script>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)