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

Error Name contains illegal characters in generated Res.kt while building jsTarget. #4295

Closed
suhaibroomy opened this issue Feb 13, 2024 · 7 comments
Assignees
Labels
bug Something isn't working web

Comments

@suhaibroomy
Copy link

Describe the bug
Error Name contains illegal characters in generated Res.kt while building jsTarget when the project name contains hyphen. This happens since the Plugin gets the project name and appends it to the generated files package name within ``. This works fine on androidTargets but generates an error with JsTarget

Affected platforms
Select one of the platforms below:

  • Web (K/Wasm) - Canvas based API

Versions

  • Kotlin version*: 1.9.22
  • Compose Multiplatform version*: 1.6.0-beta02
  • OS version(s)* (required for Desktop and iOS issues):
  • OS architecture (x86 or arm64): arm64
  • JDK (for desktop issues):

To Reproduce

  1. Create a Compose multiplatform project
  2. Add Js target
  3. Set project name to something with hyphen
  4. Add a font (or any resource) in commonResources
  5. Run ./gradlew assemble

Expected behaviour
There should be no error

@suhaibroomy suhaibroomy added bug Something isn't working submitted labels Feb 13, 2024
suhaibroomy pushed a commit to suhaibroomy/compose-multiplatform that referenced this issue Feb 13, 2024
@terrakok terrakok self-assigned this Feb 14, 2024
@Schahen Schahen added the web label Feb 14, 2024
suhaibroomy pushed a commit to suhaibroomy/compose-multiplatform that referenced this issue Feb 14, 2024
terrakok added a commit that referenced this issue Mar 4, 2024
igordmn pushed a commit that referenced this issue Mar 5, 2024
@luca992
Copy link
Contributor

luca992 commented Mar 7, 2024

is there a way to workaround this until the next stable release is up with the merged pr?

@terrakok
Copy link
Member

terrakok commented Mar 7, 2024

Yes. Just give a project name without dashes

@luca992
Copy link
Contributor

luca992 commented Mar 7, 2024

@terrakok a workaround that doesn't involve renaming directories/ changing module names that are already published on maven

luca992 added a commit to Kamel-Media/Kamel that referenced this issue Mar 8, 2024
comment out compose resources to publish and workaround:

JetBrains/compose-multiplatform#4442

JetBrains/compose-multiplatform#4295
@terrakok
Copy link
Member

terrakok commented Mar 8, 2024

You are not able to publish a library with compose resources yet. Could you explain your case?

@luca992
Copy link
Contributor

luca992 commented Mar 8, 2024

I'm using compose resources to load files in commonTest in kamel. This in combination with #4442 is preventing me from being able to publish library builds while being able to run the tests

@terrakok
Copy link
Member

#4300

@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working web
Projects
None yet
Development

No branches or pull requests

5 participants