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

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

Open
mactrash opened this issue Oct 28, 2024 · 12 comments
Open

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

mactrash opened this issue Oct 28, 2024 · 12 comments

Comments

@mactrash
Copy link

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/node_modules/.pnpm/razzle@4.2.18_@babel[email protected]_babel-preset-razzle@[email protected]_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/[email protected] start: make build-deps && razzle start
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.

@davisagli
Copy link
Member

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

@mactrash
Copy link
Author

@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
Copy link
Member

@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
Copy link
Member

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

@mactrash
Copy link
Author

@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
Copy link
Author

@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
Copy link
Member

iRohitSingh commented Nov 3, 2024

@davisagli @sneridagh

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

ERROR in ../../../node_modules/.pnpm/@[email protected]_@[email protected]_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss (../../../node_modules/.pnpm/[email protected][email protected][email protected]_/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].use[1]!../../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].use[2]!../../../node_modules/.pnpm/[email protected]/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[6].use[3]!../../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[6].use[4]!../../../node_modules/.pnpm/@[email protected]_@[email protected]_@kitconcept+volto-bu_x5bo2ca4vy463dmo6jnv33c3tm/node_modules/@kitconcept/volto-light-theme/src/theme/main.scss)
Module build failed (from ../../../node_modules/.pnpm/[email protected][email protected][email protected][email protected]_/node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  ╷
2 │ @import 'addonsThemeCustomizationsVariables';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../../../node_modules/.pnpm/@[email protected]_@[email protected]_@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/@[email protected]_@[email protected]_@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/[email protected][email protected][email protected][email protected]_/node_modules/sass-loader/dist/index.js:49:16
    at Function.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:126797:16)
    at render_closure1.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:108247:12)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:28641:20
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:20755:20
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:20800:20
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38482:49)
    at Object._Future__propagateToListeners (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5217:77)
    at _Future._completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38333:9)
    at _AsyncAwaitCompleter.completeError$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37931:12)
    at Object._asyncRethrow (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:4995:17)
    at /Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:86182:24
    at _wrapJsFunctionForAsync_closure.$protected (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:5020:15)
    at _wrapJsFunctionForAsync_closure.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37950:12)
    at _awaitOnObject_closure0.call$2 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:37944:25)
    at _RootZone.runBinary$3$3 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:39649:18)
    at _FutureListener.handleError$1 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38167:21)
    at _Future__propagateToListeners_handleError.call$0 (/Users/rohitkumar/Desktop/my-project/frontend/node_modules/.pnpm/[email protected]/node_modules/sass/sass.dart.js:38482:49)
 @ ../../../node_modules/.pnpm/@[email protected]_@[email protected]_@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/@[email protected]_@[email protected]_@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

@sneridagh
Copy link
Member

@mactrash If you don't give us the error, we cannot do anything. The config in your first comment looks fine. In the second, you didn't remove the placeholder "your_policy_addon_here".

We improved a bit the docs: https://volto-light-theme.readthedocs.io/

@iRohitSingh It seems you forgot to declare the theme in volto.config.js.

const theme = '@kitconcept/volto-light-theme';

module.exports = {
addons,
theme,
};

@stevepiercy
Copy link
Collaborator

stevepiercy commented Nov 11, 2024

@sneridagh in https://volto-light-theme.readthedocs.io/install.html we make a lot of assumptions that folks might not understand. Maybe we should add a link to https://6.docs.plone.org/volto/development/add-ons/install-an-add-on.html. Note that the commands are not displaying, but will soon as we merge plone/documentation#1770. You can see how it will look in this preview: https://plone6--1770.org.readthedocs.build/volto/development/add-ons/install-an-add-on.html

@mactrash
Copy link
Author

@sneridagh may I know what is ""your_policy_addon_here""

@mactrash
Copy link
Author

@sneridagh

While I change the volto.config.js

to
const theme = '@kitconcept/volto-light-theme';

module.exports = {
addons,
theme,
};

It result

/mnt/HDD2/VOLTO/test-com/frontend/core/packages/volto:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @plone/[email protected] start: make build-deps && razzle start
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.

@stevepiercy
Copy link
Collaborator

@sneridagh may I know what is ""your_policy_addon_here""

He means remove that line from your addons array in /frontend/package.json. It is intended as a placeholder for the name of a policy add-on that you might create.

I can't speak to the latest error message, as you need to provide a complete console output that includes the commands you used. IOW, help us reproduce the issue you experience.

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

No branches or pull requests

5 participants