SAP/ui5-tooling

ERR_PACKAGE_PATH_NOT_EXPORTED when trying to use ProjectBuilder

stefania-santimbrean opened this issue · 2 comments

Hello,

I want to use Node.js API, more specifically I am trying to use the Project Builder class.

import {ProjectBuilder} from '@ui5/project/lib/build/ProjectBuilder.js';
const builder = new ProjectBuilder();
builder.build(....)

But I get the following error:

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './build/ProjectBuilder.js' is not defined by "exports" in /.../node_modules/@ui5/project/package.json imported from ...

Can the ProjectBuilder class be exported? Or am I missing something when trying to use it?

Thanks,
Best regards,
Stefania Santimbrean

The Project Builder class is currently not exported.

I would suggest using the ProjectGraph#build method instead. It creates a ProjectBuilder instance internally and starts the build for the given project graph. Does this solve your case?

Hello @RandomByte , yes, it does solve my case. Many thanks!