VS Code SAP Fiori tools error btoa is not defined
When you try to develop a Fiori app with the SAP Fiori tools for VS Code you get the error “btoa is not defined”. This error is caused by another SAP extension: mobile Development Kit extension for Visual Studio Code. You have to disable the MDK extension to be able to use the SAP Fiori tools extension.
The incompatibility is already known in listed as an issue in GitHub. Let’s hope that the incompatibility between these two extension is solved soon. Many Fiori developers are also mobile developers and will have to be able to use both extensions.
In case you have the same issue and do not find the solution in GitHub, maybe the description here are helpful.
Steps to reproduce
Follow the SAP developers tutorial.
Run SAP Fiori tools and select an OData service.
Enter OData data source connection information.
Click on login. This will trigger a login to the service. As basic authentication is used, the username and password are Base64 encoded (btoa is used for that).
You get an error message: btoa is not defined. Installing btoa in npm is not solving the issue.
Disable extension mobile Development Kit extension for Visual Studio Code.
See GitHub issue: https://github.com/SAPDocuments/Tutorials/issues/5358
This is only a workaround. The real solution – compatibility of both extensions – must be provided by the extension developer. Until then: happy updating.
A side effect after disabling the problem causing extension is that the SAP Fiori tools can show more available generators. If you install additional generators like CAP Project and that generator shows up, the Fiori tools will work just fine.