-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
@vendure/cli scaffolding a new plugin does not work #2819
Comments
Hi Flo, Thanks for the report. This must be environment-specific. I just tried did:
It worked as expected and created the new plugin without error. This is on Node: 20.9.0 If anyone else is able to reproduce on other environments please let me know what your env looks like. |
Thx @michaelbromley for the quick reply.. just repeated your steps in a new folder without additional installation of the cli, the problem remained the same =/ |
Hello, I would like to provide additional info regarding the "Maximum call stack size exceeded" error encountered when creating a new Vendure plugin on fresh installation (vendure 2.2.2) In my Windows environment with Node.js version 20.11.1 and npm version 10.2.0, I did not encounter any issues. However, when using WSL (Ubuntu) on the same Windows machine and the same project, I was able to reproduce the reported error. To be sure, I deleted the node_modules folder and reinstalled all packages from WSL (in case the package installations are OS-specific), and the result was the same. It seems that this issue may specifically relate to certain UNIX environments, such as Linux and macOS. |
The same issue happens with me as well, I am unable to create new plugin through the cli My environment is:
◇ Canceled |
I have had some issues with node modules not working as desired due to Apple Silicon incompatibility. |
Describe the bug
Trying to scaffold a new plugin in a pristine vendure project with the CLI results in an error:
◒ Generating plugin scaffold│
■ Manipulation error: Maximum call stack size exceeded
│
│ -- Details --
│ Path: /my-shop/src/plugins/my-new-feature/my-new-feature.plugin.ts
│ Text: "import { PluginCommonModule, Type, VendurePlugin } from '@vendure/core';\r\n\r\nimport { MY_NEW_FEATURE_PLUGIN_OPTIONS } from './constants.template';\r\nimport { PluginInitOptions } from '../../my-shop/src/plugins/my-new-feature/types';\r\n\r\n@VendurePlugin({\r\n imports: [PluginCommonModule],\r\n providers: [{ provide: MY_NEW_FEATURE_PLUGIN_OPTIONS, useFactory: () => MyNewFeaturePlugin.options }],\r\n configuration: config => {\r\n // Plugin-specific configuration\r\n // such as custom fields, custom permissions,\r\n // strategies etc. can be configured here by\r\n // modifying the
config
object.\r\n return config;\r\n },\r\n compatibility: '^2.0.0',\r\n})\r\nexport class MyNewFeaturePlugin {\r\n static options: PluginInitOptions;\r\n\r\n static init(options: PluginInitOptions): Type {\r\n this.options = options;\r\n return MyNewFeaturePlugin;\r\n }\r\n}\r\n"│ Stack: RangeError: Maximum call stack size exceeded
│ at parseMemberExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32312:47)
│ at parseLeftHandSideExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32308:88)
│ at parseUpdateExpression (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32283:30)
│ at parseUnaryExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32202:38)
│ at parseBinaryExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32124:31)
│ at parseAssignmentExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:31795:24)
│ at /my-shop/node_modules/@ts-morph/common/dist/typescript.js:32984:50
│ at doOutsideOfContext (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:29426:18)
│ at allowInAnd (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:29447:18)
│ at parseObjectLiteralElement (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32984:33)
│
■ Error: Manipulation error: Maximum call stack size exceeded
│
│ -- Details --
│ Path: /my-shop/src/plugins/my-new-feature/my-new-feature.plugin.ts
│ Text: "import { PluginCommonModule, Type, VendurePlugin } from '@vendure/core';\r\n\r\nimport { MY_NEW_FEATURE_PLUGIN_OPTIONS } from './constants.template';\r\nimport { PluginInitOptions } from '../../my-shop/src/plugins/my-new-feature/types';\r\n\r\n@VendurePlugin({\r\n imports: [PluginCommonModule],\r\n providers: [{ provide: MY_NEW_FEATURE_PLUGIN_OPTIONS, useFactory: () => MyNewFeaturePlugin.options }],\r\n configuration: config => {\r\n // Plugin-specific configuration\r\n // such as custom fields, custom permissions,\r\n // strategies etc. can be configured here by\r\n // modifying the
config
object.\r\n return config;\r\n },\r\n compatibility: '^2.0.0',\r\n})\r\nexport class MyNewFeaturePlugin {\r\n static options: PluginInitOptions;\r\n\r\n static init(options: PluginInitOptions): Type {\r\n this.options = options;\r\n return MyNewFeaturePlugin;\r\n }\r\n}\r\n"│ Stack: RangeError: Maximum call stack size exceeded
│ at parseMemberExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32312:47)
│ at parseLeftHandSideExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32308:88)
│ at parseUpdateExpression (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32283:30)
│ at parseUnaryExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32202:38)
│ at parseBinaryExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32124:31)
│ at parseAssignmentExpressionOrHigher (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:31795:24)
│ at /my-shop/node_modules/@ts-morph/common/dist/typescript.js:32984:50
│ at doOutsideOfContext (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:29426:18)
│ at allowInAnd (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:29447:18)
│ at parseObjectLiteralElement (/my-shop/node_modules/@ts-morph/common/dist/typescript.js:32984:33)
│ at throwError (/my-shop/node_modules/ts-morph/dist/ts-morph.js:2375:19)
│ at doManipulation (/my-shop/node_modules/ts-morph/dist/ts-morph.js:2373:9)
│ at replaceSourceFileForFilePathMove (/my-shop/node_modules/ts-morph/dist/ts-morph.js:2801:5)
│ at SourceFile._moveInternal (/my-shop/node_modules/ts-morph/dist/ts-morph.js:13424:9)
│ at SourceFile.move (/my-shop/node_modules/ts-morph/dist/ts-morph.js:13400:19)
│ at generatePlugin (/my-shop/node_modules/@vendure/cli/dist/commands/add/plugin/create-new-plugin.js:184:16)
│ at async Object.createNewPlugin [as run] (/my-shop/node_modules/@vendure/cli/dist/commands/add/plugin/create-new-plugin.js:90:54)
│ at async addCommand (/my-shop/node_modules/@vendure/cli/dist/commands/add/add.js:47:50)
│ at async Command. (/my-shop/node_modules/@vendure/cli/dist/cli.js:52:5)
│ at async Command.parseAsync (/my-shop/node_modules/@vendure/cli/node_modules/commander/lib/command.js:936:5)
│
└ ❌ Error
◇ Canceled
➜ my-shop
To Reproduce
Steps to reproduce the behavior:
npx @vendure/create my-shop
npm i -D @vendure/cli
npx vendure add
select│ ● [Plugin] Create a new Vendure plugin
Expected behavior
Scaffold the folder-structure and files of a new plugin called
my-new-feature
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: