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

Incompatibility with ts-loader #46

Closed
stavalfi opened this issue Aug 10, 2019 · 7 comments
Closed

Incompatibility with ts-loader #46

stavalfi opened this issue Aug 10, 2019 · 7 comments

Comments

@stavalfi
Copy link

It looks like something breaks this awesome plugin.


index.ts:

import Editor from '@editor/editor'

export default Editor

editor.tsx

// @ts-ignore
import DrawFlow from './draw-flow'

export default class Editor {}

console.log(DrawFlow)

draw-flow.js

export default () => {}


errors: (only with ts-loader)

Circular dependency detected:
packages/editor/src/draw-flow.js -> packages/editor/src/editor.tsx -> packages/editor/src/draw-flow.js

error

Circular dependency detected:
packages/editor/src/editor.tsx -> packages/editor/src/draw-flow.js -> packages/editor/src/editor.tsx


I minimized one of the packages which those errors appeared:

https://github.com/stavalfi/jstream

branch: reproduce-bug

run: yarn install --ignore-scripts && yarn editor

all the webpack stuff is here: cd packages/build/.config/webpack

all this is installed here: packages/build/package.json

"circular-dependency-plugin": "^5.1.0",
"webpack": "^4.35.0",
"ts-loader": "^6.0.0",
"typescript": "^3.5.2",

Please tell me if i can be any assistent to you.

@aackerman
Copy link
Owner

Would you mind including your plugin configuration?

@stavalfi
Copy link
Author

stavalfi commented Aug 10, 2019

new CircularDependencyPlugin({
      exclude: /node_modules/,
      failOnError: true,
      allowAsyncCycles: false,
      cwd: mainFolderPath, // it's the root of the git repository
    })

@stavalfi
Copy link
Author

@aackerman did you find out any clues?

@aackerman aackerman changed the title no compatability with ts-loader Incompatibility with ts-loader Aug 31, 2019
@aackerman
Copy link
Owner

I spent a couple hours, but I wasn't able to figure it out. I wasn't able to generate a test case that appeared to have the same errors and the setup for jsstream wasn't clear enough for me to break down why it was causing a problem.

@aackerman
Copy link
Owner

@stavalfi would you be able to break this down into a smaller test case?

@stavalfi
Copy link
Author

stavalfi commented Sep 1, 2019

yes. your work here is a must have in almost any kind of a build system.

In my build system, i extracted all build-related stuff to a different package in the same mono-repo so it is easier to setup a new package with a complete build in couple of minutes (Create React App for mono repos)

@aackerman
Copy link
Owner

I believe this is fixed in 5.2.2. Please let me know if it's not and I will reopen.

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

2 participants