If you have encountered the below issue, when you try to publish the extension using VS Code for NAV 2018, then it is not an issue with the code or the container, but the issue is with the visual studio code version.
If you are have installed AL extension for NAV 2018 on any version greater than VS Code 1.5 then you will get the above error, I haven’t spent much time to find the real cause of it, but the resolution is to uninstall/roll back the new version and install the September 2020 1.50 version. If you are developing an extension for BC then you don’t have to do anything.
You can find the old version of VS Code in the below link
If you have any other tips or suggestions, please do share them in the comments below.