Question
· Feb 9

Comiling not possible. ERROR #16006

Hello dear developers,

I am currently doing an internship and learning about InterSystems IRIS and ObjectScript and have downloaded and installed the community version of IRIS.

I have not made any changes in the Management Portal.
In Visual Studio Code I have loaded the InterSystems ObjectScript Extension Pack.

If I now want to compile a file, VSC throws an error:
"ERROR #16006: Document name 'x.csp' is invalid"

The name of the file is "index.csp"

This error also appears when I try to compile other files.
I have noticed that the first 4 characters of the name are always missing.

The error occurs with the file "index_test.csp":
"ERROR #16006: Document name 'x_test.csp' is invalid"

Do I have to make another setting? or is the problem somewhere else?

Kind regards

Product version: IRIS 2023.3
Discussion (11)3
Log in or sign up to continue

@Daniel Goerke 
What learning course/training steps are you following? Do you mean to be creating CSP files? CSP files need to be stored inside a web application so they can be served by the web server. They can't be created as standalone files without that context. Therefore, you need to have the CSP file in folders that tell VS Code what web application it goes it. For example, if you want to create mypage.csp in web application /csp/user, the path to the file inside your local workspace should be something like src/csp/user/mypage.csp. You may also find it easier to edit web application files directly on your IRIS server using server-side editing.

It looks like you used VS Code to directly open the folder (C:\InterSystems\IRIS\CSP\goerke\) which your (local desktop instance) IRIS created for the /csp/goerke webapp it configured when you added a GOERKE namespace using IRIS Portal.

I think this is going to get confusing for you, particularly if you try to use documentation or training material.

Here's what I recommend you do:

1. Close your the folder in VS Code.

2. Copy your C:\InterSystems\IRIS\CSP\goerke into a folder where you will edit your source files, and perhaps in future source-control them with Git. For example, copy it to c:\MyProjects

3. Open the newly-created folder in VS Code (e.g. c:\MyProjects\goerke)

4. Reconfigure your /csp/goerke webapp in IRIS Portal so it points again to C:\InterSystems\IRIS\CSP\goerke

5. Delete all contents of C:\InterSystems\IRIS\CSP\goerke (files and folders), since you already have a copy of these in c:\MyProjects\goerke

Now when you edit a CSP file in VS Code and save it under c:\MyProjects\goerke\src a copy of it will appear in C:\InterSystems\IRIS\CSP\goerke and the /csp/goerke webapp will use this.

When you edit a CLS file in VS Code, saving this writes the class into the GOERKE namespace but doesn't create a file under C:\InterSystems\IRIS\CSP\goerke because IRIS classes live in IRIS databases, not in host OS files.

Everything worked well. Many thanks for the tip.

I have now saved the files to be edited in:

D:\IRIS\src\...
 


But is it normal that I have to have a separate folder in the "src\csp\"? Because if I simply edit the .csp in the "csp" folder and compile it, I get the "Non-JSON response" error again.
This in itself is not a problem for me, I just want to understand what triggers this error.