Closed mrbryo closed 2 months ago
I did find old bug report 138 and that fix is in place still.
Hi Brian,
thanks for opening this issue! Just for clarity:
I did find old bug report 138 and that fix is in place still.
Do you mean the bug still exists or the fix described in https://github.com/cap-js/cds-typer/issues/138 still works?
Best, Daniel
I think the bug still exists or something related to it. The fix in that 138 ticket is in place but yet I get the same error.
Hi Brian,
I see that the error apparently comes up when running cds build
. I have added a fix that quotes the path of the output directory in cds-typer's build task, which should hopefully resolve the error and will be included in the next release.
Still, I have two questions:
cds init
that would create a project with a space in its name will usually fail. So I guess you deliberately renamed the project after its creation. I can imagine a few scenarios in which you would need spaces in your project's path, like company policy, auto-generated user names, etc, but in any other case I would like to recommend using a space-less project name.Best, Daniel
Hi Daniel,
Nothing obfuscated. I haven't renamed the project. BTW, should have said in the initial creation of this ticket, this is all done in SAP Build Code. The versions indicated are what Code setup. I did notice after creating the project, while I was creating the entities I was getting some CDS errors about cds-typer missing.
TyperNotInstalledError: Will not attempt to generate types as the type generator is not installed in your CDS project. Install @cap-js/cds-typer as dependency of your project to enable type generation for this project
Even after building I'm getting the above error. I haven't modified the package.json to remove or add cds-typer library like we do when setting up a regular CAPM project in BAS. I'm trying to stick with what the default setup in Build Code provides.
Thanks, Brian
Hi Brian,
then I am actually confused as to how you ended up with a project with a space in it. 🤔
Regarding the other issue you found: how did you introduce cds-typer into your project?
Best, Daniel
Hey Daniel,
Where is there a space? Oh, just realized, I think I may have pasted the title from the other ticket I've referenced. Sorry for the confusion. I'm just getting the same error as the other ticket but there is no space in the project name. But after an initial build it looks like it has resolved itself. When I build now that error isn't showing up.
I haven't introduced cds-typer at all. I was trying to use SAP Build Code as is and not modify the package.json file to let Build Code manage it. Should I open a different issue? Or can you tell me if I'm expected to add cds-typer myself?
Sorry for the confusion, Brian
Hi Brian,
no worries, that clears up some of the confusion!
I haven't introduced cds-typer at all.
If I am not mistaken, the issue appears when you execute cds build
. That implies that cds-typer is present in your project.
cds-typer is usually introduced to your project by executing cds add typer
. We still only put it into your package.json for you, so you still have to install it manually, as we do not want to execute npm i
for you.
We do not have a dedicated BAS section in CAPire, but most of the VSCode section in the doc also applies.
Let me know if that helps.
Best, Daniel
Hey Daniel,
OK I'll use the cds add typer
, I figured Build Code had a way to do it itself. My team is just starting to use the tool and learn it compared to just "regular" BAS.
Thanks! Brian
Hi Brian,
great! Still, I'd like to note that cds-typer is actually an optional tool that improves code completion for JavaScript projects and type information for TypeScript projects. It is not strictly needed, so your mileage may vary.
If you run into any more problems with cds-typer, feel free to open another ticket here.
Best, Daniel
Is there an existing issue for this?
Nature of Your Project
JavaScript
Current Behavior
CDS Output from building the CAP v8 Project:
Node.js v20.12.0
Expected Behavior
No Errors
Steps To Reproduce
Build a CAP project in Business Application Studio.
Environment
Repository Containing a Minimal Reproducible Example
No response
Anything else?
No response