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

Unresolved reference: any class inside graphql module #3071

Closed
AngeloFilaseta opened this issue Jan 22, 2024 · 7 comments
Closed

Unresolved reference: any class inside graphql module #3071

AngeloFilaseta opened this issue Jan 22, 2024 · 7 comments
Assignees
Labels

Comments

@AngeloFilaseta
Copy link
Contributor

Importing the graphql module in another module by adding it to the commonMain as a dependency seems to have no effect.
The problem occurs when importing the module using the statically defined Project.alchemist(module: String) function.
The bug won't appear when importing other multiplatform projects (for example, web-render).

Only the IntelliJ IDE is able to find the classes and will recognize the import as valid, suggesting a successful import.

Further investigation is required to better understand the problem.

Maybe the alchemist-graphql gradle configuration is involved in the issue, since some code generation is involved during the build process.

To reproduce the bug, simply import the graphql module in a multiplatform project as a dependency in the commonMain block and try to use any class offered. Build will fail upon compiling, here's an example output:

> Task :alchemist-web-renderer:compileKotlinJvm FAILED
e: file:///home/angelo/AngeloFilaseta/Alchemist/Alchemist/alchemist-web-renderer/src/commonMain/kotlin/it/unibo/alchemist/boundary/webui/common/Graph.kt:12:36 Unresolved reference: graphql
e: file:///home/angelo/AngeloFilaseta/Alchemist/Alchemist/alchemist-web-renderer/src/commonMain/kotlin/it/unibo/alchemist/boundary/webui/common/Graph.kt:16:9 Unresolved reference: GraphQLClientFactory
@AngeloFilaseta AngeloFilaseta self-assigned this Jan 22, 2024
@DanySK
Copy link
Member

DanySK commented Jan 23, 2024

This is puzzling. Ca you retry as soon as #3014 gets merged? It's a big refactoring, maybe this one gets accidentally solved.

@AngeloFilaseta
Copy link
Contributor Author

Sure, thanks. If necessary, I can submit a pull request demonstrating the issue, in case this approach doesn't work out.

@AngeloFilaseta
Copy link
Contributor Author

Unfortunately, it didn't solve the problem. It seems to me that the only way to find out what breaks the imports is to remove pieces of configuration until I find out. I'll try to do it next week.

@AngeloFilaseta
Copy link
Contributor Author

This issue will be solved after merging #3253.
The problem was caused by the application (or ktor) plugin. It seems like applying these plugins have some unknown side effect on the creation of the classpath.

@AngeloFilaseta
Copy link
Contributor Author

I have some additional info: it seems like merging #3253 did not solve the problem. BTW, the problem is surely related to the application plugin. Adding the withJava() directive to all the jvm targets seems to fix the problem. When possible I'll open a PR with the final fix.

@AngeloFilaseta
Copy link
Contributor Author

missclicked. ouch.

@AngeloFilaseta
Copy link
Contributor Author

Upon merging #3386 this will finally be closed once and for all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants