Skip to content

Vite doesn't work with a custom theme that packaged as jar #13538

Description

@jorginius

Description of the bug

Vite cannot find and serve a custom theme that packaged as jar.

Minimal reproducible example

extend-existing-app-theme-demo with vaadin.version=23.0.3 and com.vaadin.experimental.viteForFrontendBuild=true.

Expected behavior

It should work just like in webpack.

Actual behavior

application-theme-plugin/theme-loader cannot find the packaged theme because the themeResourceFolder value on vaadin-dev-server-settings.json is not correct .

The application starts in dev mode but vite dev server cannot find the resources. It's looking for them in frontend/themes but they are in target/flow-frontend/themes

custom-theme-demo with vaadin.version=23.0.3 and webpack works properly.

Versions:

- Vaadin / Flow version: 23.0.3
- Java version: 17.0.1
- Development or production mode: development

Activity

  1. self-assigned this
    on Apr 14, 2022
  2. added 3 commits that reference this issue on Apr 14, 2022
    14496ce
    9022e6d
    3991fb5
  3. added a commit that references this issue on Apr 20, 2022
    db3773f
  4. added a commit that references this issue on Apr 20, 2022
    4774cc5
  5. added a commit that references this issue on Apr 26, 2022
    5d8d1ea
  6. vaadin-bot commented on May 2, 2022

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with Vaadin 23.0.8.

  7. 3 remaining items

  8. Artur- commented on May 12, 2022

    @Artur-
    Member

    Is the original test case still valid for testing this?

  9. jorginius commented on May 12, 2022

    @jorginius
    Author

    I think so.

    The "Minimal reproducible example" is the
    extend-existing-app-theme-demo

    The demo uses a packaged theme (custom-theme) and extends it. The fix solves the first part (i.e. reusing-theme-jar-demo works fine) but you cannot inherit from custom.

  10. caalador commented on May 13, 2022

    @caalador
    Contributor

    On the flow test side it would be flow-tests/test-application-theme/test-reusable-as-parent/ that fails with vite due to the alias resolution not being run each time the alias is encountered, but only once it seems.

    So now it sets the alias to the reusable folder, as it is gotten first, and can't then find the actual theme files anymore as they arre not under target.

  11. mshabarov commented on May 24, 2022

    @mshabarov
    Contributor

    To be cherry-picked to Vaadin 22 manually.

  12. self-assigned this
    on May 24, 2022
  13. added 2 commits that reference this issue on May 25, 2022
    aca05de
    44f3466
  14. added a commit that references this issue on May 30, 2022
    e61f5df
  15. vaadin-bot commented on Jun 3, 2022

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with Vaadin 23.1.0.rc2 and is also targeting the upcoming stable 23.1.0 version.

  16. vaadin-bot commented on Jun 7, 2022

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with Vaadin 22.0.16.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions