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

generator.run is not a function error after installing 5.0.0 #796

Closed
sneridagh opened this issue Nov 15, 2023 · 6 comments
Closed

generator.run is not a function error after installing 5.0.0 #796

sneridagh opened this issue Nov 15, 2023 · 6 comments

Comments

@sneridagh
Copy link

Type of issue

Bug


My environment

  • OS version/details: eg. Windows 10 64-bit
  • Node version: v20.9.0 (run node --version in your terminal)
  • npm version: 10.1.0 (run npm --version in your terminal)
  • Version of yo : 5.0.0 (run yo --version in your terminal)

Expected behavior

It does not break after a breaking is released. If a breaking change is issued (thus, the breaking), then provide upgrade notes.

Current behavior

After running my generator command (working on 4.x.x):

yo @plone/volto my-volto-app --description "test volto project" --volto . --skip-install --no-interactive

I got

generator.run is not a function
@sneridagh
Copy link
Author

I've been debugging and it seems that the culprit is a call to a subgenerator using this.composeWith in my generator.
It seems the subgenerator is never called, it just bails out with the generator is not a function error.

from: https://github.com/plone/volto/blob/main/packages/generator-volto/generators/app/index.js#L262-L268

    this.composeWith(require.resolve('../addon'), {
      addonName: this.opts.defaultAddonName
        ? this.opts.defaultAddonName
        : `volto-${this.globals.projectName}`,
      outputpath: base,
      interactive: false,
    });

The subgenerator works well standalone.

@sneridagh
Copy link
Author

@mshima I saw you introduced a bunch of async/await here and there, I bet it's one missing somewhere.

@sneridagh
Copy link
Author

Ok, I've found the culprit, the yeoman-generator version in the generator was too old. I've updated to the latest (non ESM) version and it works well there.

However, message to the maintainers: Breaking things without proper release notes is not polite in OSS. A simple table with a version compatibility matrix will suffice, and will serve as documentation for yourself too.

@JoshuaKGoldberg
Copy link

version compatibility matrix

Tracked in #802.

@JoshuaKGoldberg
Copy link

version compatibility matrix

Tracked in #802, which has a comment with a table courtesy of the excellent @jozefizso: #802 (comment).

@ntt77
Copy link

ntt77 commented Jan 24, 2025

same issue. and I can't use other way because SharePoint is required to use this

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

3 participants