Description
When I'm trying to get the custom generator working, it fails with an error stating that BaseGenerator is not exported.
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/generators/BaseGenerator' is not defined by "exports" in /app/generator/node_modules/@api-platform/create-client/package.json imported from /app/generator/Generator.js
at new NodeError (node:internal/errors:405:5)
at exportsNotFound (node:internal/modules/esm/resolve:366:10)
at packageExportsResolve (node:internal/modules/esm/resolve:713:9)
at packageResolve (node:internal/modules/esm/resolve:899:14)
at moduleResolve (node:internal/modules/esm/resolve:973:20)
at defaultResolve (node:internal/modules/esm/resolve:1193:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:39) {
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
}
How to reproduce
Use the following package.json file:
API Platform version(s) affected: 3.2.20
Description
When I'm trying to get the custom generator working, it fails with an error stating that
BaseGenerator
is not exported.How to reproduce
Use the following package.json file:
Take generator and template from documentation https://api-platform.com/docs/create-client/custom/
Execute:
Additional Context
From what I see in the package.json file at https://github.com/api-platform/create-client/blob/main/package.json#L65, custom generators are tested only inside the
create-client
module.