Vlt training error in razzle.config file


AFTER INSTALLATION AND ADDING THE ADD ONS TO THE package.json , when i restart the frontend server , i am getting these issues . How do i resolve these razzle.config issues..

i am following the volto light theme training..


whenever i am restarting the frontend server i am getting this issues

You can make it easier for someone to help you:

  1. Paste text instead of adding a screenshot. Screenshots can be hard to read and make it impossible to copy and paste text.
  2. Show what you did before you got the error so it's possible to identify where it diverged from the training.
1 Like

FIRSTLY , I INITIATED A PROJECT WITH: pipx run cookieplone project

  1. Then, once the project was created, i changed the directory into the project title and ran command make install

  2. Then, i started the frontend and backend server with make backend-start , and make frontend-start commands , respectively.

4)Then, i looged into the frontend server using username and password.

5)Then, using the steps in the training =To install VLT, navigate to the frontend/packages/volto-my-project folder and run the following command:
pnpm install @kitconcept/volto-light-theme@6.0.0-alpha.2
I ran the above command

6)then i added the add ons to the package.json file: "addons": [
"@eeacms/volto-accordion-block",
"@kitconcept/volto-button-block",
"@kitconcept/volto-heading-block",
"@kitconcept/volto-highlight-block",
"@kitconcept/volto-introduction-block",
"@kitconcept/volto-separator-block",
"@kitconcept/volto-slider-block",
"@kitconcept/volto-light-theme"
],

7)Then , i added this line of code to volto.config : const theme = '@kitconcept/volto-light-theme';

8)The next step was to restart the frontend server, which i did using make install (which ran correctly) , but when i did the make start command, it showed errors in the razzle.config.js file which is located in the project-name/frontend/core/packages/volto path in the project.

the error was regarding modePath being not defined : ERROR Unexpected error

TypeError: Cannot read properties of undefined (reading 'modulePath')
at defaultModify (/home/aryan/Desktop/VOLTO-LIGHT-THEME/voltolight/frontend/core/packages/volto/razzle.config.js:331:57)
at modifyWebpackConfig (/home/aryan/Desktop/VOLTO-LIGHT-THEME/voltolight/frontend/core/packages/volto/razzle.config.js:457:27)
at /home/aryan/Desktop/VOLTO-LIGHT-THEME/voltolight/frontend/node_modules/.pnpm/razzle@4.2.18_@babel+core@7.26.7_babel-preset-razzle@4.2.18_eslint@8.57.1_html-webpack-plugin_73qfcy3qxfrbf6qz5ku7jv7o24/node_modules/razzle/config/createConfigAsync.js:1069:22
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
/home/aryan/Desktop/VOLTO-LIGHT-THEME/voltolight/frontend/core/packages/volto:
ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL @plone/volto@18.0.0 start: make build-deps && razzle start
Exit status 1
ELIFECYCLE Command failed with exit code 1.
make: *** [Makefile:45: start] Error 1

@aryanbodke

FIRSTLY , I INITIATED A PROJECT WITH: pipx run cookieplone project

Expressing yourself with uppercase letters is considered disrespectful. I guess you are a grown up enough to already know.

I don't know how I'm even answering you, but I'm doing it. Only for you to know that I followed your own instructions. AND THEY WORKED.

Cheers,
V.

i am sorry, i didn't knew that the uppercase causes disrespect... will remember from next time to use lowercase...

I did these steps many times and it still shows the same error in razzle.config.js

And regarding expressing myself, i just wanted to highlight how i started the process, not by any other intentions, I'm here to learn and explore, and not to disrespect any member,
Sorry again if it caused any disrespect,but my intentions were only to solve my error

Thank you,

1 Like

@aryanbodke The problem is that you put the addons list into the wrong package.json. There is a package.json in your /frontend/packages/volto-my-project folder, where you should put in the

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

Below i tried to visualize the folder structure

Project Structure

.
├── backend/
├── CHANGELOG.md
├── dependabot.yml
├── devops/
├── docker-compose.yml
├── frontend
│ ├── core
│ │ ├── apps/
│ │ ├── CODE_OF_CONDUCT.md
│ │ ├── CONTRIBUTING.md
│ │ ├── docs/
│ │ ├── g-api/
│ │ ├── LICENSE.md
│ │ ├── lint-staged.config.js
│ │ ├── logos/
│ │ ├── Makefile
│ │ ├── package.json # Wrong package.json (Its for Volto Core)
│ │ ├── packages/
│ │ ├── PACKAGES.md
│ │ ├── patches/
│ │ ├── pnpm-lock.yaml
│ │ ├── pnpm-workspace.yaml
│ │ ├── README.md
│ │ ├── RELEASING.md
│ │ ├── requirements-docs.txt
│ │ ├── SECURITY.md
│ │ ├── styles/
│ │ ├── tsconfig.json
│ │ └── variables.mk
│ ├── cypress/
│ ├── cypress.config.js
│ ├── Dockerfile
│ ├── jest-addon.config.js
│ ├── Makefile
│ ├── mrs.developer.json
│ ├── node_modules/
│ ├── package.json # <-- Wrong package.json (I guess you put it in here)
│ ├── packages
│ │ └── volto-my-project # <-- Your project (where you most of the time will work when you do something with the frontend)
│ │ ├── babel.config.js
│ │ ├── CHANGELOG.md
│ │ ├── locales/
│ │ ├── news/
│ │ ├── node_modules
│ │ ├── package.json # <-- Right package.json (you should put in addons list here)
│ │ ├── public/
│ │ ├── src/
│ │ ├── towncrier.toml
│ │ └── tsconfig.json
│ ├── pnpm-lock.yaml
│ ├── pnpm-workspace.yaml
│ ├── public/
│ ├── README.md
│ └── volto.config.js
├── Makefile
├── public/
├── README.md
└── version.txt

2 Likes

Thank you sir, I will try and update it by your way..

Thank you, this really solved my razzle issues..
Thank you :pray:t2:

no problem :slight_smile: