Describe the bug
A project we upgraded from 15 -> 16 uses javascript add-ins and we use node.js to handle our web development portion of this. The new compiler throws many errors when trying to compile and there is no way to ignore specific files/folders. I would consider this a bug because the alc.exe was previously working and is no longer working with no code changes at all.
The below error is one of hundreds because of the xml files inside of the node_modules folder.
warning AL1026: A warning occurred during XML validation: 'Cannot load the web service at the specified location, c:\ALProjectFolder\node_modules\selenium-webdriver\lib\test\data\transformable.xml, due to the following error: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.'.
error AL1061: An error occurred during file validation: 'It is only allowed to have a migration file, with target 'OnPrem''
To Reproduce
npm install on the AL project folder(you must have node.js installed)N/A
Expected behavior
We should be able to define an ignore pattern. For example, you would not commit node_modules into source control, so you place a .gitignore file at the root of the project and include the node_modules folder. A similar pattern with .alignore would be excellent. It would not have any breaking changes and would be source control safe.
Screenshots
5. Versions:
Yes, if the AL compiler insists on compiling everything it finds, there should be a way to tell it not to bother.
An ALignore would be great.
Perhaps .gitignore could be used if ALignore is absent, or even use both. It seems unlikely that you'll have any ignored AL code, and that would avoid having to copy and paste from .gitignore to ALignore.
Can you provide a sample project to reproduce the issue? It definitely looks like a bug.
Can you provide a sample project to reproduce the issue? It definitely looks like a bug.
Hi atoader, I created a demo project. It contains the AL: Go! base project, plus a basic Angular project configured as the getting started from Angular Getting Started. I removed all .gitignores, so you can clone this repository and try to build and see the error straight away. The repo is pretty large because it contains the node_modules folder, normally this would be in the gitignore and not checked in, but you need it for the alc.exe to fail.
Steps
Clone: https://github.com/kevindstanley1988/ALWebProjectCompileFail
open root folder in Visual Studio Code
ctrl+shift+B to try and build the project.
You will get a massive list of warnings and a couple of errors even though it should never be reading any of these files. There is currently no way to tell the al compiler to ignore files, so this is a massive problem when it comes to development workflow.
c:\Users\Administrator\Documents\AL\ALProject5\web\my-app\node_modules\selenium-webdriver\lib\test\data\transformable.xml, due to the following error: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.'.
error AL1061: An error occurred during file validation: 'It is only allowed to have a migration file, with target 'OnPrem''.
Compilation ended at '9:59:28.966'.
Error: The package could not be created
Note: the use of Angular is incidental here, any AL project that uses a NPM(Node package manager) based web project inside of it causes this issue. NPM based projects bring in the node_modules, which is a development only folder for web.
Thank you very much!
Adding a note here. Ignoring individual files still won't resolve the problem. I was going through the node_modules folder and started to remove any files that the AL compiler was picking up that it shouldn't and there are hundreds - if not thousands, I gave up deleting individual files because the alc.exe would always find more. This means we need a way to ignore entire folders from being compiled(as well as files).
Facing same issues with my Angular extensions. Would indeed be nice exclude folders from al build process.. Any progress done already?
I have marked the bug as in-progress. We will work on this in the following weeks.
May I add that we are actually generating al files which shouldn't be tracked but are referenced by our project. So please don't skip files from the compiler that are part of .gitignore, some people actually depend on it for builds.
tsconfig.json in Typescript has include/exclude keys to include/skip files/folders for compilation, maybe you could go a similar path in app.json?
We've also had bad performance when compiling/publishing in the past because all folders/files are recursively checked but it would be great to be able to help the compiler out by specifying where to begin (relative to app.json) and what to skip.
This would also make working on multiple projects (AL + Web) in an extension easier.
For example, controladdins have relative paths to resources and can't go above the root of the compiler ("../../", since that wouldn't map nicely with the IIS mapping) or and if you have package.json+node_modules, you must keep it out of AL project's scope and constantly move the bundled files between places instead of just being able to develop it as a single project - the VS Code extension tends to assume that everything is AL-related, so relaxing that a bit (by making the scope of its watcher more narrow) it must gain us better performance too, right?