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

Unexpected non-whitespace character after JSON in @plone/volto #6528

Open
me-kell opened this issue Dec 11, 2024 · 15 comments
Open

Unexpected non-whitespace character after JSON in @plone/volto #6528

me-kell opened this issue Dec 11, 2024 · 15 comments

Comments

@me-kell
Copy link

me-kell commented Dec 11, 2024

Which versions are known to work with @plone/volto?

Describe the bug

(node:1611) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
This version of the generator works for Volto version 18.x.x.
If you want to generate a project for another version of Volto
then use the appropriate version.
See https://6.docs.plone.org/volto/contributing/version-policy.html#volto-generator-compatibility-with-volto-label.

Getting latest Volto version
Using latest released Volto version: 17.20.2
✖️ An error occured while running @plone/volto:app#prompting
Error @plone/volto volto
Unexpected non-whitespace character after JSON at position 3 (line 1 column 4)

To Reproduce

npm install -g yo @plone/generator-volto
yo @plone/volto volto

Software (please complete the following information):

uname -a
    Linux debian12 6.1.0-22-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.94-1 (2024-06-21) x86_64 GNU/Linux

for i in python3 pip npm nvm node yo; do echo "$i = $($i --version)"; done
    python3 = Python 3.11.2
    pip = pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)
    npm = 10.9.0
    nvm = 0.40.1
    node = v22.12.0
    yo = 5.0.0
@wesleybl
Copy link
Member

@me-kell to create a Volto 17 project, you need to use volto-generator 7 or 8. See:

https://6.docs.plone.org/volto/contributing/version-policy.html#volto-generator-compatibility-with-volto-label

For Volto 17 you should use node 20.

@stevepiercy
Copy link
Collaborator

I think our Node.js support policy should be more clear https://6.docs.plone.org/volto/contributing/version-policy.html#node-js, explicitly stating that Node.js 22 is not supported in Volto 17, only Node.js 18 and 20. @sneridagh can you confirm?

@Kartikayy007
Copy link

yeah I agree too @wesleybl the issue appears to be caused by two factors:

  1. Node.js Version Incompatibility
    • You’re currently using Node.js v22.12.0, but Volto 17.x.x is only compatible with Node.js 18 and Node.js 20.
    • To resolve this, downgrade your Node.js version using nvm:

nvm install 20
nvm use 20

  1. Generator Version Mismatch

For Volto 17.x.x, you need to use volto-generator 7 or 8.

Follow these steps to install the correct generator version:
1. Switch to Node.js 20:

nvm use 20

2.	Clear the npm cache:

npm cache clean --force

3.	Install the correct generator version:

npm install -g @plone/generator-volto@8

4.	Generate the Volto project:

yo @plone/volto my-volto-project

This would resolve the problem successfully

@stevepiercy
Copy link
Collaborator

@me-kell to fix documentation, what is the URL of the instructions you followed?

We definitely need to update the documentation for Install Plone with cookiecutter-plone-starter (deprecated) and Install Plone with Cookieplone to refer to the compatibility matrix in https://6.docs.plone.org/volto/contributing/version-policy.html#volto-generator-compatibility-with-volto-label.

Are there other places?

I created a new issue to track version compatibility in #6540.

@me-kell
Copy link
Author

me-kell commented Dec 15, 2024

@stevepiercy

I followed the Install Plone with Cookieplone - Node.js.

There it is stated "1. Install or update the supported LTS versions of Node.js, then activate the version supported in Volto. nvm install --lts and nvm use --lts". The current LTS version is 22.

I would suggest to make an explicit link to https://6.docs.plone.org/install/create-project-cookieplone.html#prerequisites-for-installation and/or to https://6.docs.plone.org/volto/contributing/version-policy.html as well also to explicitly state which version is supported in the installation page.

@stevepiercy
Copy link
Collaborator

@me-kell what did you use to generate your project, Cookieplone or volto-generator?

You linked to the docs for Cookieplone, which only works with Volto 18. Did you want to create a project for Volto 17 or earlier?

We started work to fix documentation in #6541.

@me-kell
Copy link
Author

me-kell commented Dec 17, 2024

@stevepiercy

@me-kell what did you use to generate your project, Cookieplone or volto-generator?

I'm just trying both to verify different installation steps.

@stevepiercy
Copy link
Collaborator

@me-kell please provide the steps you followed so we can reproduce the issue.

@me-kell
Copy link
Author

me-kell commented Dec 18, 2024

@me-kell please provide the steps you followed so we can reproduce the issue.

@stevepiercy please see how to reproduce in original comment above.

@stevepiercy
Copy link
Collaborator

@me-kell OK, I followed those two steps before, then stopped, as you didn't provide steps to go further. Here's the output.

$ npm install -g yo @plone/generator-volto
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm warn deprecated [email protected]: This package is no longer supported. Please use @npmcli/package-json instead.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This package is no longer supported.

changed 1263 packages in 19s

145 packages are looking for funding
  run `npm fund` for details

 02:57:29  stevepiercy@Steves-MacBook-Pro  ...Plone/documentation/atest  🐍 3.12.2 3.11.5 3.10.13 system  ⬡ v20.10.0   6.0 ✘ ✹ ✭  19s 
$ yo @plone/volto volto
This version of the generator works for Volto version 18.x.x.
If you want to generate a project for another version of Volto
then use the appropriate version.
See https://6.docs.plone.org/volto/contributing/version-policy.html#volto-generator-compatibility-with-volto-label.

Getting latest Volto version
Using latest released Volto version: 18.4.0
? Would you like to add addons? (false) 

Where did you find those two instructions in the first place? The only place I found npm install -g yo @plone/generator-volto was in https://6.docs.plone.org/install/create-project.html#yeoman-and-the-volto-boilerplate-generator, and yo @plone/volto volto absolutely nowhere. I searched the source code of both Volto and Documentation.

@me-kell
Copy link
Author

me-kell commented Dec 18, 2024

@stevepiercy
Copy link
Collaborator

stevepiercy commented Dec 18, 2024

@me-kell thank you! I just opened an issue in Training plone/training#906 to track its curation for the first link. This is a problem every year, where code and processes change while the training lags behind, especially if it was not conducted within the last year.

For the second link, there are two different usages that we should update, but I don't know to what.

npm init yo @plone/volto
yo @plone/volto

I'm happy to update the packages/generator-volto/README.md, or refer people to Cookieplone instead. @plone/volto-team can I get an assist from y'all?

@me-kell
Copy link
Author

me-kell commented Dec 18, 2024

Version Policy - Node.js says:

  • Node.js 22 LTS: Supported since Volto 18.

And the template generates a package.json with

  "engines": {
    "node": "^18 || ^20"
  },

Is this ok?

@stevepiercy
Copy link
Collaborator

I don't know, but that's a good question, which is being discussed in #6528 (comment).

@wesleybl
Copy link
Member

And the template generates a package.json with

"engines": {
"node": "^18 || ^20"
},
Is this ok?

@me-kell Volto 18 is no longer tested with node 18. So I think it would be good to change that. You can make a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Status: Needs discussion
Development

No branches or pull requests

4 participants