kitconcept / volto-light-theme

https://light-theme.kitconcept.io
11 stars 8 forks source link

Volto 18 how can I correct install this, please update document #426

Open mactrash opened 1 week ago

mactrash commented 1 week ago

I follow the step added dependencies and addon

make install etc

And got below when try to run with pnpm start

TypeError: Cannot read properties of undefined (reading 'modulePath') at defaultModify (/mnt/HDD2/VOLTO/test-com/frontend/core/packages/volto/razzle.config.js:331:57) at modifyWebpackConfig (/mnt/HDD2/VOLTO/test-com/frontend/core/packages/volto/razzle.config.js:457:27) at /mnt/HDD2/VOLTO/test-com/frontend/nodemodules/.pnpm/razzle@4.2.18@babel+core@7.26.0_babel-preset-razzle@4.2.18_eslint@8.57.1_html-webpack-plugin_nvra5mldcm7qyfv3nq5oebxjbi/node_modules/razzle/config/createConfigAsync.js:1069:22 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) /mnt/HDD2/VOLTO/test-com/frontend/core/packages/volto:  ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @plone/volto@18.0.0-alpha.47 start: make build-deps && razzle start Exit status 1  ELIFECYCLE  Command failed with exit code 1.

davisagli commented 1 week ago

@sneridagh Is this because the theme needs to be configured a different way with a pnpm-based project?

mactrash commented 6 days ago

@sneridagh Is this because the theme needs to be configured a different way with a pnpm-based project?

I don't sure, yarn pnpm ... already make me confuse. maybe now is not the time to study

sneridagh commented 6 days ago

@mactrash I think you detected a problem in the instructions. @kitconcept/volto-light-theme is an add-on too, and should be declared as one:

const addons = ['@kitconcept/volto-light-theme'];
const theme = '@kitconcept/volto-light-theme';

module.exports = {
  addons,
  theme,
};

Sorry about that, I will update the instructions right now.

sneridagh commented 6 days ago

@mactrash I double check, the instructions are correct, but could be confusing. We would improve them soon. Make sure that both are specified.

mactrash commented 6 days ago

@sneridagh please forgive me, I cam complete new to Volto

Is that

  1. add

"dependencies": { "@eeacms/volto-accordion-block": "^10.4.0", "@kitconcept/volto-button-block": "^2.3.1", "@kitconcept/volto-dsgvo-banner": "^1.3.0", "@kitconcept/volto-heading-block": "^2.4.0", "@kitconcept/volto-highlight-block": "^3.0.0", "@kitconcept/volto-introduction-block": "^1.0.0", "@kitconcept/volto-separator-block": "^4.0.0", "@kitconcept/volto-slider-block": "^6.0.0", "@kitconcept/volto-light-theme": "^2.0.0", }

to /frontend/package.json

  1. modify

/frontend/volto.config.js

as

const addons = ['@kitconcept/volto-light-theme']; const theme = '@kitconcept/volto-light-theme';

module.exports = { addons, theme, };

  1. pnpm install

no error

  1. HOST=x.x.x.x pnpm start

and result

sswp> !!! Script exited with code 1

And frontend not started

mactrash commented 6 days ago

@davisagli I also try

add "dependencies": { "@eeacms/volto-accordion-block": "^10.4.0", "@kitconcept/volto-button-block": "^2.3.1", "@kitconcept/volto-dsgvo-banner": "^1.3.0", "@kitconcept/volto-heading-block": "^2.4.0", "@kitconcept/volto-highlight-block": "^3.0.0", "@kitconcept/volto-introduction-block": "^1.0.0", "@kitconcept/volto-separator-block": "^4.0.0", "@kitconcept/volto-slider-block": "^6.0.0", "@kitconcept/volto-light-theme": "^2.0.0", }

add

"addons": [ "@eeacms/volto-accordion-block", "@kitconcept/volto-button-block", "@kitconcept/volto-heading-block", "@kitconcept/volto-introduction-block", "@kitconcept/volto-highlight-block", "@kitconcept/volto-separator-block", "@kitconcept/volto-light-theme", "your_policy_addon_here" ],

to /frontend/package.json

modify /frontend/volto.config.js

as

const addons = ['@kitconcept/volto-light-theme']; const theme = '@kitconcept/volto-light-theme';

module.exports = { addons, theme, };

pnpm install no error

HOST=x.x.x.x pnpm start and result

sswp> !!! Script exited with code 1

And frontend not started

iRohitSingh commented 1 day ago

@davisagli @sneridagh

I also tried setting up vlt in frest project generated by cookieplone and getting this error

ERROR in ../../../node_modules/.pnpm/@kitconcept+volto-light-theme@5.0.1_@eeacms+volto-accordion-block@10.4.6_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss (../../../node_modules/.pnpm/css-loader@5.2.7_webpack@5.90.1_esbuild@0.24.0_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!../../../node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.90.1_esbuild@0.24.0_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!../../../node_modules/.pnpm/resolve-url-loader@3.1.5/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[6].use[3]!../../../node_modules/.pnpm/sass-loader@10.5.2_sass@1.80.6_webpack@5.90.1_esbuild@0.24.0_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[6].use[4]!../../../node_modules/.pnpm/@kitconcept+volto-light-theme@5.0.1_@eeacms+volto-accordion-block@10.4.6_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss)
Module build failed (from ../../../node_modules/.pnpm/sass-loader@10.5.2_sass@1.80.6_webpack@5.90.1_esbuild@0.24.0_/node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  ╷
2 │ @import 'addonsThemeCustomizationsVariables';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../../../node_modules/.pnpm/@kitconcept+volto-light-theme@5.0.1_@eeacms+volto-accordion-block@10.4.6_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss 2:9  root stylesheet
SassError: SassError: Can't find stylesheet to import.
  ╷
2 │ @import 'addonsThemeCustomizationsVariables';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../../../node_modules/.pnpm/@kitconcept+volto-light-theme@5.0.1_@eeacms+volto-accordion-block@10.4.6_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss 2:9  root stylesheet
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass-loader@10.5.2_sass@1.80.6_webpack@5.90.1_esbuild@0.24.0_/node_modules/sass-loader/dist/index.js:49:16
    at Function.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:126797:16)
    at render_closure1.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:108247:12)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:28641:20
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:20755:20
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:20800:20
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:86182:24
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/sass@1.80.6/node_modules/sass/sass.dart.js:38482:49)
 @ ../../../node_modules/.pnpm/@kitconcept+volto-light-theme@5.0.1_@eeacms+volto-accordion-block@10.4.6_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss 8:6-600 22:17-24 26:7-21 58:25-39 59:36-47 59:50-64 63:6-73:7 64:54-65 64:68-82 70:42-53 70:56-70 72:21-28 83:0-570 83:0-570 84:22-29 84:33-47 84:50-64 61:4-74:5
 @ ../../../node_modules/.pnpm/@kitconcept+volto-light-theme@5.0.1_@eeacms+volto-accordion-block@10.4.6_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/customizations/@root/theme.js 5:0-55
 @ ./src/start-client.jsx 6:0-21
 @ ./src/client.js 3:0-36 4:0-6

webpack 5.90.1 compiled with 1 error in 9013 ms

git diff

index e256491..1598f9f 100644
--- a/frontend/packages/volto-my-project/package.json
+++ b/frontend/packages/volto-my-project/package.json
@@ -26,7 +26,12 @@
     "release-major-alpha": "release-it major --preRelease=alpha",
     "release-alpha": "release-it --preRelease=alpha"
   },
-  "dependencies": {},
+  "addons": [
+    "@kitconcept/volto-light-theme"
+  ],
+  "dependencies": {
+    "@kitconcept/volto-light-theme": "^5.0.1"
+  },
   "peerDependencies": {
     "react": "18.2.0",
     "react-dom": "18.2.0"

Volto: "version": "18.0.0", VLT: 5.0.1