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

Custom themes are not working #2413

Open
anssit opened this issue Aug 31, 2021 · 2 comments
Open

Custom themes are not working #2413

anssit opened this issue Aug 31, 2021 · 2 comments
Labels
bug Severity: Blocker Severity - Highest out of blocker, major and minor

Comments

@anssit
Copy link
Contributor

anssit commented Aug 31, 2021

Steps to reproduce

  1. Import the attached project my-app.zip to IDE
  2. Open hello-world-view.ts in Designer

Actual behavior

Custom theme is not applied. For example, the padding defined in frontend/themes/myapp/views/hello-world-view.css is not applied.

Browser console log:

theme-bundle.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)

Server side log:

INFO: Starting node process: node ./node_modules/rollup/dist/bin/rollup --config target/designer/rollup.config.js
Aug 30, 2021 11:02:15 AM com.vaadin.designer2.services.flow.NodeProcessRunner start
INFO: 

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module '/Users/anssit/Downloads/mun-app/node_modules/rollup/dist/bin/rollup'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Expected behavior

Custom theme is applied.

IDE, Designer and OS version

Designer 4.6.9
Project Vaadin version: 14.x (check also with 21.x)

@anssit anssit added bug Severity: Blocker Severity - Highest out of blocker, major and minor labels Aug 31, 2021
@anssit
Copy link
Contributor Author

anssit commented Aug 31, 2021

After manually installing rollup for bundling the custom theme, the next error appears:

Uncaught ReferenceError: applyTheme$1 is not defined at theme-bundle.js:3

This might have to do with the following (in theme-bundle.js):

import { applyTheme as applyTheme$1 } from 'themes/com.vaadin.flow.theme.AbstractTheme.class/com.vaadin.flow.theme.AbstractTheme.class.generated.js';

Vaadin 14 uses a slightly different annotation for specifying the theme:

  • @Theme(themeFolder = "myapp") V14
  • @Theme(value = "myapp") V20

This may be the culprit.

@szolo
Copy link
Contributor

szolo commented Feb 12, 2024

This is still an issue. rollup does not work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Severity: Blocker Severity - Highest out of blocker, major and minor
Projects
None yet
Development

No branches or pull requests

2 participants