blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

Circular dependency warning during build #699

Closed svobik7 closed 3 years ago

svobik7 commented 3 years ago

What is the problem?

During build process of current canary following warning occurred in terminal output: @blitzjs/core: Circular dependency: src/supertokens.ts -> src/public-data-store.ts -> src/supertokens.ts

Steps to Reproduce

  1. open your local blitz repo cd blitz
  2. run yarn to install deps
  3. run yarn build

Versions

macOS Catalina | darwin-x64 | Node: v12.18.3

blitz: 0.22.3-canary.0 (global)
blitz: 0.24.0-canary.1 (local)

  Package manager: yarn 
  System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 700.73 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/cli: Not Found
    @prisma/client: Not Found
    blitz: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: 4.0.3 => 3.8.3 
svobik7 commented 3 years ago

After additional circular imports check by running madge . --extensions ts,tsx -c in root folder I found there are 6 circual dependency warnings.

Processed 472 files (13.8s) (101 warnings)
✖ Found 6 circular dependencies!

1) packages/core/dist/packages/core/src/middleware.d.ts > packages/core/dist/packages/core/src/types.d.ts
2) packages/core/src/middleware.ts > packages/core/src/types.ts
3) packages/core/src/supertokens.ts > packages/core/src/public-data-store.ts
4) packages/file-pipeline/src/transform.ts > packages/file-pipeline/src/types.ts > packages/file-pipeline/src/helpers/file-cache.ts
5) packages/file-pipeline/src/types.ts > packages/file-pipeline/src/helpers/file-cache.ts > packages/file-pipeline/src/utils.ts
6) packages/installer/src/recipe-executor.tsx > packages/installer/src/recipe-renderer.tsx
alexnaiman commented 3 years ago

Hello! Can I try to tackle this issue for the Hacktoberfest2020? If so, can you assign it to me?

svobik7 commented 3 years ago

@alexnaiman sure, go for it 👍