SAP-docs / sapui5

This is the markdown version of the official SAPUI5 documentation from the SAPUI5 Demo Kit for external contributions.
Creative Commons Attribution 4.0 International
89 stars 138 forks source link

[doc issue] Typescript walkthrough missing dependency @ui5/builder #157

Closed crater2150 closed 1 month ago

crater2150 commented 2 months ago

Issue description

When following the Typescript walkthrough, after "Step 2" it is no longer possible to run npm start, as it fails with the error

Failed to load task repository. Missing dependency to '@ui5/builder'? Error: Cannot find package '@ui5/builder' imported from <app root dir>/node_modules/@ui5/project/lib/graph/ProjectGraph.js

The problem seems to be fixable with npm install @ui5/builder --save-dev, which is not mentioned in the documentation. Should this work without that step?

Feedback Type (Optional)

content gaps

Page Title on SAP Help Portal (prefilled)

Step 2: Bootstrap (TypeScript)

Page URL on SAP Help Portal (prefilled)

https://ui5.sap.com/#/topic/32b14d88bd484cd7b941aae37180f732

KvM2 commented 2 months ago

Hi @crater2150 , thanks for your contribution! We'll look into it and get back to you.

KlattG commented 1 month ago

Hi @crater2150 , have you followed all the tutorial steps in the correct order? In Step 1 you are required to run npm install --save-dev @ui5/cli. This should have prevented the problem. Does the problem get fixed with this input?

crater2150 commented 1 month ago

I just reran all commands from the tutorial on another machine, the error still occurs. I also re-ran npm install --save-dev @ui5/cli. Curiously, according to package-lock.json, the @ui5/builder package is installed, but in node_modules/@ui5/cli/node_modules/@ui5/builder, while installing it manually will put it in node_modules/@ui5/builder, thus fixing the problem. So this is probably a packaging issue, not a documentation issue.

I've attached package-lock.pre.json (state before running npm install -D '@ui5/builder') and package-lock.post.json (state afterwards). package-lock.pre.json package-lock.post.json

flovogt commented 1 month ago

Hi @crater2150, thanks a lot for reaching out to us. I guess its a mismatch between lock file and node modules.

Could you please delete:

Afterwards execute a npm i in your project.

crater2150 commented 1 month ago

Hi @flovogt, As I said, I reran all commands from the tutorial on a different PC, so without a preexisting package-lock.json. I just noticed I mixed up the pre- and post manual install lockfiles, I'm sorry if that caused confusion.

But I have good news, when I tried to reproduce the issue just now, everything worked after step 2. I'm not sure what changed, the lock file only differs in some version numbers and I started from an empty directory like last time :shrug:

flovogt commented 1 month ago

@crater2150 Happy to see your setup works and thanks a lot for opening this issue here. This will help many devs in future.