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 17.0.alpha14, cookiecutter-plone-starter: Error: Unable to find 'razzle-plugin-scss' or scss/razzle-plugin' #4920

Closed
fredvd opened this issue Jun 27, 2023 · 4 comments · Fixed by collective/cookiecutter-plone-starter#93

Comments

@fredvd
Copy link
Sponsor Member

fredvd commented Jun 27, 2023

Created a new volto project with

When I use cookiecutter-plone-starter to set u a new Plone 6 project with the latest Volto 17.apha14, make install-frontend succeeds, but starting the frontend gives the traceback below. Running
yarn add razzle-plugin-scss --dev solves the problem.

Maybe I'm using the wrong volto_generator_version, it defaults to 6.3.1 and I cannot find any newer version for the alpha's. @sneridagh Am I indeed using a volto 16 generator version for the 17 alphas?

 ERROR  Unexpected error

Error: Unable to find 'razzle-plugin-scss' or scss/razzle-plugin'
    at loadPlugin (/Users/fred/demo/volto-demo/frontend/node_modules/razzle/config/loadPlugins.js:61:11)
    at loadPlugin (/Users/fred/demo/volto-demo/frontend/node_modules/razzle/config/loadPlugins.js:8:12)
    at /Users/fred/demo/volto-demo/frontend/node_modules/razzle/config/loadPlugins.js:69:12
    at Array.map (<anonymous>)
    at loadPlugins (/Users/fred/demo/volto-demo/frontend/node_modules/razzle/config/loadPlugins.js:68:18)
    at /Users/fred/demo/volto-demo/frontend/node_modules/razzle/config/loadRazzleConfig.js:47:9
    at new Promise (<anonymous>)
    at module.exports (/Users/fred/demo/volto-demo/frontend/node_modules/razzle/config/loadRazzleConfig.js:12:10)
    at /Users/fred/demo/volto-demo/frontend/node_modules/razzle/scripts/start.js:53:5
    at new Promise (<anonymous>)
    at main (/Users/fred/demo/volto-demo/frontend/node_modules/razzle/scripts/start.js:52:10)
    at Object.<anonymous> (/Users/fred/demo/volto-demo/frontend/node_modules/razzle/scripts/start.js:246:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
make[1]: *** [start] Error 1
make: *** [start-frontend] Error 2
@davisagli
Copy link
Sponsor Member

Hmm, I got the same error earlier today while trying volto 17 on a project that was previously using volto 16 -- but I was able to resolve it by updating razzle to 4.2.18 like it says in the upgrade guide.

Probably needs a close look to see what is going wrong with the generator. Does yarn why razzle reveal multiple versions of razzle used in different places, by any chance?

@davisagli
Copy link
Sponsor Member

@fredvd @sneridagh says an alpha of the generator is needed. Make sure you're setting the environment variable that was added here: collective/cookiecutter-plone-starter#87

(Maybe we can make the cookiecutter do that automatically based on the selected version, instead of needing an env var?)

@fredvd
Copy link
Sponsor Member Author

fredvd commented Jun 27, 2023

I started the project with Volto 17, but the cookiecutter / stable 3.6.x volto generator creates a package.json with razzle 4.2.17. I bumped that version to 4.2.18 manuall and reran yarn, but that didn't help, so maybe that's also what happens when upgrading Volto from 16 to 17.

Would be nice indeed if cookiecutter could switch the Volto generator listed based on the Volto version. I didn't do that because I was almost at the end of the wizard and didn't want to restart the thing again for setting an env variable. :-)

@fredvd
Copy link
Sponsor Member Author

fredvd commented Jun 28, 2023

I tested once more, merged the PR and tested it right away after that. The volto generator version now correctly selects an alpha version as well if you pass in an alpha Volto version. If you stick with a 16.20 volto version the generator is using the released 6.3.1.

Thank you @davisagli & reviewers !!

> cookiecutter https://github.com/collective/cookiecutter-plone-starter
You've downloaded /Users/fred/.cookiecutters/cookiecutter-plone-starter before. Is it okay to delete and re-download it? [yes]: yes
project_title [Project Title]: testsite2
project_slug [testsite2]:
description [A new project using Plone 6.]:
author [Plone Foundation]:
email [collective@plone.org]:
python_package_name [testsite2]:
Select python_test_framework:
1 - pytest
2 - unittest
Choose from 1, 2 [1]: 1
plone_version [6.0.6]:
volto_version [16.21.2]: 17.0.0-alpha.15
volto_generator_version [7.0.0-alpha.4]:

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

Successfully merging a pull request may close this issue.

2 participants