volto icon indicating copy to clipboard operation
volto copied to clipboard

make frontend-start does not work with the latest main branch tip

Open silviubogan opened this issue 8 months ago • 17 comments

Describe the bug make install retrieves the version (git tag) 18.14.0 of Volto, and when running make frontend-start they work well together. When entering the cookieplone-project/frontend/core directory and running git checkout main and git pull (checkouts https://github.com/plone/volto/commit/6be2100b0ca009fe04c39720dc1a0d29bd757fb3), the make frontend-start, ran in cookieplone-project, throws an error.

To Reproduce Steps to reproduce the behavior:

  1. Use Cookieplone to create a new frontend project
  2. Before starting the backend or frontend run make install
  3. Inside frontend/core run git checkout main
  4. In the project directory run make frontend-start

Expected behavior The SSR server should start and point to an URL. But, instead, I get the following error:

Screenshots Image

Software:

  • Volto Version 18.14.0 and main
  • Plone Version - don't know how to find it, I work with a project which is about a few weeks, and I believe make install installs the latest Plone version (don't know if stable or unstable)
  • Plone REST API Version - don't know

silviubogan avatar May 13 '25 13:05 silviubogan

Please don't upload images of error messages.

https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors

The usage you described is not supported. When you want to update Volto, you should instead generate a new project via Cookieplone, specifying the version to which you want to update, then move your project from the current to the new one. See https://6.docs.plone.org/volto/upgrade-guide/#upgrade-18-cookieplone-label.

We might need to add some documentation somewhere to help other developers from falling into this same trap. Can you suggest what might have helped you avoid this situation?

stevepiercy avatar May 13 '25 21:05 stevepiercy

@stevepiercy

We might need to add some documentation somewhere to help other developers from falling into this same trap. Can you suggest what might have helped you avoid this situation?

I want to have a single project preferably, because I don't think that a new version of Volto or Plone should require major changes to the directory structure and config files. I prefer to make these changes step by step. I don't have many files changed locally in the frontend/core directory of my Cookieplone project. I use my Cookieplone project to test both the Volto core and add-ons, including a custom one for experiments.

ANOTHER REASON for having a single Cookieplone project is the backend Docker volume and container. I tried to run make backend-start like this: DELETE_EXISTING=1 make backend-start (I remember I saw that in the docs somewhere) and it does not work. I tried to run make clean and make stack-rm and they both don't remove the container from my system. I had the experience of having to reinstall the OS on my laptop and being unable to easily extract the data I wanted from the containers' volumes mostly because they were too many and had cryptic names.

silviubogan avatar May 13 '25 22:05 silviubogan

Plone follows semantic versioning. See https://plone.org/download/release-schedule for why what you want is not possible for major version upgrades. You tried to upgrade 18.4.0 to main which is where 19.x.x is currently being developed.

For minor version upgrades, it might be possible, but I haven't tried it. You'd have to check out the 18.x.x branch and pull to test. I also don't know whether it is a supported method to upgrade for minor or bugfix version bumps. @sneridagh may be able to advise whether it is supported.

For the backend Docker container issue, I would suggest looking for existing issues or creating a new one at https://github.com/plone/cookieplone-templates/issues.

stevepiercy avatar May 13 '25 22:05 stevepiercy

Describe the bug make install retrieves the version (git tag) 18.14.0 of Volto, and when running make frontend-start they work well together. When entering the cookieplone-project/frontend/core directory and running git checkout main and git pull (checkouts 6be2100), the make frontend-start, ran in cookieplone-project, throws an error.

To Reproduce Steps to reproduce the behavior:

  1. Use Cookieplone to create a new frontend project
  2. Before starting the backend or frontend run make install
  3. Inside frontend/core run git checkout main
  4. In the project directory run make frontend-start

@silviubogan What if the new version (main) has new dependencies? You MUST run pnpm install (as opposed to make install) again in the frontend directory. Also, please note that main is Volto 19 alpha nowadays. Probably you don't want that in your project (yet).

To my understanding, there's no trap anywhere.

sneridagh avatar May 14 '25 06:05 sneridagh

@stevepiercy I posted this: https://github.com/plone/cookieplone-templates/issues/237.

@sneridagh I tried running pnpm install and I get the same error. I want the latest main commit because I am working on the docs.

silviubogan avatar May 14 '25 06:05 silviubogan

@silviubogan ok, then you need to update the built packages. Sorry for forgetting that could be it too.

pnpm build:all in core.

make install takes care of this. What I would do then is to change the version (although temporarily) in mrs.developer.json, then discard it when you finished. The other option is checkout volto in their own repo (not inside to a project), then the make install applies to the local version only.

sneridagh avatar May 14 '25 07:05 sneridagh

@sneridagh

@silviubogan ok, then you need to update the built packages. Sorry for forgetting that could be it too.

pnpm build:all in core.

make install takes care of this. What I would do then is to change the version (although temporarily) in mrs.developer.json, then discard it when you finished. The other option is checkout volto in their own repo (not inside to a project), then the make install applies to the local version only.

Sorry for misunderstanding. So the order is this?

  1. make install (the pnpm build:all in core is to be omitted because it is done by make install)
  2. Update mrs.developer.json
  3. Run the missdev command

silviubogan avatar May 14 '25 12:05 silviubogan

@sneridagh npm build:all does not function well:

╰─❯ pnpm build:all

> plone-frontend@ build:all /home/silviub/Desktop/Pro/project-title/frontend/core
> pnpm --filter @plone/registry --filter @plone/client --filter @plone/components --filter @plone/providers --filter @plone/react-router build

No projects matched the filters "@plone/react-router" in "/home/silviub/Desktop/Pro/project-title/frontend/core"
Scope: 4 of 18 workspace projects
packages/registry build$ tsup
[12 lines collapsed]
│ ESM dist/addon-registry/create-addons-styles-loader.js  1.37 KB
│ CLI Building entry: src/index.ts, src/addon-registry/addon-registry.ts, src/addon-registry/create-addons-loader.ts, src/addon-registry/creat…
│ CLI Using tsconfig: tsconfig.json
│ CLI tsup v8.4.0
│ CLI Using tsup config: /home/silviub/Desktop/Pro/project-title/frontend/core/packages/registry/tsup.config.ts
│ CLI Target: es2022
│ CLI Cleaning output folder
│ CJS Build start
│ ESM Build start
│ ESM dist/index.js                                       10.38 KB
│ ESM dist/addon-registry/addon-registry.js               21.96 KB
│ ESM dist/addon-registry/create-addons-loader.js         2.55 KB
│ ESM dist/addon-registry/create-addons-locales-loader.js 949.00 B
│ ESM dist/addon-registry/create-addons-styles-loader.js  1.37 KBfrontend/core/packages/client/tsup.config.ts
│ ESM dist/addon-registry/create-theme-loader.js          1.38 KB
│ ESM ⚡ Build success in 34ms
│ CJS dist/index.cjs                                       11.25 KB
│ CJS dist/addon-registry/addon-registry.cjs               24.68 KB
│ CJS dist/addon-registry/create-addons-loader.cjs         4.42 KB
│ CJS dist/addon-registry/create-addons-locales-loader.cjs 2.71 KB
│ CJS dist/addon-registry/create-addons-styles-loader.cjs  3.16 KB
│ CJS dist/addon-registry/create-theme-loader.cjs          3.25 KB
│ CJS ⚡ Build success in 34ms
│ DTS Build start
│ src/addon-registry/addon-registry.ts(9,19): error TS2307: Cannot find module 'deepmerge' or its corresponding type declarations.
│ Error: error occurred in dts build
│     at Worker.<anonymous> (/home/silviub/Desktop/Pro/project-title/frontend/node_modules/.pnpm/[email protected]_@[email protected]_@t…
│     at Worker.emit (node:events:518:28)
│     at MessagePort.<anonymous> (node:internal/worker:268:53)
│     at [nodejs.internal.kHybridDispatch] (node:internal/event_target:827:20)
│     at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
│ DTS Build errorcjs 160.63 KB
└─ Failed in 3.3s at /home/silviub/Desktop/Pro/project-title/frontend/core/packages/registry
packages/client build$ tsup
[3 lines collapsed]
│ CLI Using tsup config: /home/silviub/Desktop/Pro/project-title/frontend/core/packages/client/tsup.config.ts
│ CLI Target: es2022
│ CLI Cleaning output folder
│ CJS Build start
│ ESM Build start
│ ESM dist/index.js 56.96 KB
│ ESM ⚡ Build success in 94ms
│ CJS dist/index.cjs 63.76 KB
│ CJS ⚡ Build success in 96ms
│ DTS Build start
└─ Running...
packages/components build$ tsup && pnpm build:css
[3 lines collapsed]
│ CLI Using tsup config: /home/silviub/Desktop/Pro/project-title/frontend/core/packages/components/tsup.config.ts
│ CLI Target: es2022
│ CLI Cleaning output folder
│ CJS Build start
│ ESM Build start
│ CJS dist/index.cjs 160.63 KB
│ CJS ⚡ Build success in 131ms
│ ESM dist/index.js 132.49 KB
│ ESM ⚡ Build success in 139ms
│ DTS Build start
└─ Running...
/home/silviub/Desktop/Pro/project-title/frontend/core/packages/registry:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @plone/[email protected] build: `tsup`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
 WARN   Local package.json exists, but node_modules missing, did you mean to install?

silviubogan avatar May 14 '25 12:05 silviubogan

@silviubogan you have to pnpm install first in order to get a stable environment, deepmerge is still missing from it. So pnpm i or make install, then pnpm build:all.

sneridagh avatar May 20 '25 07:05 sneridagh

Sorry for misunderstanding. So the order is this?

  1. make install (the pnpm build:all in core is to be omitted because it is done by make install)
  2. Update mrs.developer.json
  3. Run the missdev command

No, you have a couple ways of accomplish what you want. You have to understand what's going on in the cookieplone setup works.

In the output of cookieplone, have a tagged version of Volto set. If you want to setup another tag or branch, and you want to use the cookieplone means of doing things:

You amend mrs.developer.json as in:

  "core": {
    "output": "./",
    "package": "@plone/volto",
    "url": "[email protected]:plone/volto.git",
    "https": "https://github.com/plone/volto.git",
    "branch": "main",
    "filterBlobs": true
  },

Then you run again make install. All should be good if you follow this steps, as make install also runs the build of the packages in core.

The other option is do it "manually" as you did.

Go to core, git checkout main. You are in main. Go to the monorepo, pnpm i (running make install will git checkout again core to the pinned version in mrs.developer.json. Then you have the current main dependencies installed. Go to core again. Run pnpm build:all then all the packages are built to the latest version. Then you go up again to the monorepo. make start.

Anyways, for developing Volto, I would checkout Volto itself as standalone. I only follow this approach if I am developing Volto at the same time that I'm developing a project.

I hope it helps!

sneridagh avatar May 20 '25 07:05 sneridagh

@sneridagh Works well. I believe that these pieces of information should be in docs.

silviubogan avatar May 20 '25 07:05 silviubogan

@silviubogan marked for taking care of it in the Beethoven Sprint next week.

sneridagh avatar May 21 '25 08:05 sneridagh

@sneridagh I've started working. There is only this issue remaining IMHO. I've seen that make install does not run git pull in the core Volto directory. What command should I specify for this in the docs? I tried npx missdev and npx missdev@latest but I don't know if I have the latest version and the docs on the home page of mrs.developer do not offer an indication on how to solve these issues:

1

╰─❯ npx missdev@latest
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/missdev - Not found
npm error 404
npm error 404  'missdev@latest' is not in this registry.
npm error 404
npm error 404 Note that you can also install from a
npm error 404 tarball, folder, http url, or git url.
npm error A complete log of this run can be found in: /home/silviub/.npm/_logs/2025-05-26T06_59_24_206Z-debug-0.log

2

╰─❯ cd frontend/core
╰─❯ npx missdev
node:fs:562
  return binding.open(
                 ^

Error: ENOENT: no such file or directory, open 'mrs.developer.json'
    at Object.openSync (node:fs:562:18)
    at Object.readFileSync (node:fs:446:35)
    at develop (/home/silviub/Desktop/Pro/project-title/frontend/node_modules/.pnpm/[email protected]/node_modules/mrs-developer/src/index.js:303:18)
    at Object.<anonymous> (/home/silviub/Desktop/Pro/project-title/frontend/node_modules/.pnpm/[email protected]/node_modules/mrs-developer/src/command.js:27:1)
    at Module._compile (node:internal/modules/cjs/loader:1554:14)
    at Object..js (node:internal/modules/cjs/loader:1706:10)
    at Module.load (node:internal/modules/cjs/loader:1289:32)
    at Function._load (node:internal/modules/cjs/loader:1108:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:220:24) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'mrs.developer.json'
}

Node.js v22.14.0

3

╰─❯ cd frontend
╰─❯ npx missdev

Using ./
Found core at core
✓ update core to branch main
node:fs:562
  return binding.open(
                 ^

Error: ENOENT: no such file or directory, open 'tsconfig.json'
    at Object.openSync (node:fs:562:18)
    at Object.readFileSync (node:fs:446:35)
    at writeConfigFile (/home/silviub/Desktop/Pro/project-title/frontend/node_modules/.pnpm/[email protected]/node_modules/mrs-developer/src/index.js:346:8)
    at develop (/home/silviub/Desktop/Pro/project-title/frontend/node_modules/.pnpm/[email protected]/node_modules/mrs-developer/src/index.js:314:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'tsconfig.json'
}

Node.js v22.14.0

silviubogan avatar May 26 '25 07:05 silviubogan

@sneridagh The docs look like this, but the misunderstanding above prevails:

How to upgrade the Volto version in a project created with Cookieplone

You do not have to use git pull in the shell inside the frontend core directory.

This is done automatically by mrs.developer.js when you run make install in the root of the project directory.

The make install command runs mrs.developer.js which reads the info from {file}frontend/mrs.developer.json.

Then every time you run make install in the root of the project, it reestablishes the version of Volto and its related projects according to the {file}mrs.developer.json file.

You can edit the {file}mrs.developer.json file so that inside the object at the key core there will be:

"branch": "main",
"filterBlobs": true

and remove the key tag.

Running make install will download the latest commit in the tip of the branch main. After you finish your job with the latest commit on the main branch, you can discard the changes using a Git command: git checkout mrs.developer.json and running make install again.

Although the general recommendation is to create a new Cookieplone project when you want to work with newer versions of the packages, this way works, but is not supported.

After running make install you can easily run make frontend-start (for full-stack Cookieplone projects) or make start for frontend-add-on-only Cookieplone projects.

silviubogan avatar May 26 '25 07:05 silviubogan

@sneridagh I thought for a moment that mrs-developer does not know to update to the tip of the main branch if the actual commit is already on that branch, but not the latest commit. I checked and this is not a bug of mrs-developer in our case.

silviubogan avatar May 26 '25 11:05 silviubogan

@silviubogan The project setup was not thought to be able to deal with full fledged Volto development. In fact, it's a nice collateral effect. The use of mrs-developer allows you to setup tags and branches, but to an extent that is functional with projects/add-ons development, where you will need the 90% of the time a fixed tag or branch for quickly testing something. Also, use it, is merely a convenience thing, so we have a place to hardcode the version we'd like to use in our project/add-on so lately CI can also grab it and test and build the images. We could have done it with bare git commands.

I find myself fixing a lot of times bugs in Volto while developing a project or add-on, and it's nice that this collateral effect allows you to do that, but this should not be the usual case while implementing a project/add-on.

While we could certainly improve the mrs-developer capabilities, I think that it's not worth the effort and it's better that we focus in delivering fixes and features to Volto. Up to you of course, but I think we had this part covered with a good set of features. You are always at a (cd core && git pull) command of what you want to do, and you can easily write a Makefile command for that.

If you are more than bugfixing something, use a bare core checkout, not the one that's inside a project/add-on.

sneridagh avatar May 27 '25 07:05 sneridagh

Hi There! 👋

We haven't seen any activity on this issue in a while :sleeping:, and we want to make sure that it's still relevant.

If updating to the latest version of Volto doesn't help, please let us know by:

  • adding a comment about what needs to be done next 💬
  • updating its status and other labels 🏷️

Otherwise close this issue. 🧹

github-actions[bot] avatar Nov 24 '25 00:11 github-actions[bot]