Docbuilder can not debug on windows, throw error: cannot read run file

I fllow the official document: Debugging to open debug mode。but failed, the command line output as follows:

Windows PowerShell
版权所有(C) Microsoft Corporation。保留所有权利。

安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows

PS C:\Users\etsme> docbuilder
USAGE: documentbuilder "path_to_script_file"
PS C:\Users\etsme> docbuilder script.docbuilder
error: cannot read run file
PS C:\Users\etsme> SET V8_USE_INSPECTOR=1
PS C:\Users\etsme> docbuilder script.docbuilder
error: cannot read run file
PS C:\Users\etsme> docbuilder --version
error: cannot read run file
PS C:\Users\etsme> docbuilder -v
v8.1.0.169
sdk version:  8.1.0 (build:169)

Hello @isNaN,
Make sure the following is correct:

You are running the command prompt or PowerShell as an administrator.
The file script.docbuilder actually exists in C:\Users\etsme.

Yes,docbuilder script file exists, the above code is show how i got the app version。the following is my test debug feature code.

I also tried the following code, and it did not output the expected debug link.

SET V8_USE_INSPECTOR=1\
docbuilder .\builder.scripts

Hello @isNaN,
As we can see, the file script.docbuilder exists but is not located in the specified path for execution.
We recommend moving the script.docbuilder file to the folder C:\Users\etsme.
Otherwise, the script will not run because the file cannot be found when executing from the folder.

@ Roman thanks your replay. i have tried you solution, but it’s not work also.

Hello @isNaN

I don’t quite see the file with .docbuilder extension that is used by Document Builder. You are executing some .scripts file instead of used format. What is the point of that?

the builder.scripts content as followed,the codes from official demo:

builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph, oRun;
oParagraph = oDocument.GetElement(0);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Dear John Smith.");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("ONLYOFFICE is glad to announce that starting today, you are appointed Commercial director to the company of your dream.");
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oRun = Api.CreateRun();
oRun.SetBold(true);
oRun.AddText("Please note: ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.AddText("this text is used to demonstrate the possibilities of ");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.SetBold(true);
oRun.AddText("ONLYOFFICE Document Builder");
oParagraph.AddElement(oRun);
oRun = Api.CreateRun();
oRun.AddText(" and cannot be used as real appointment to the position in any real company.");
oParagraph.AddElement(oRun);
oDocument.Push(oParagraph);
oParagraph = Api.CreateParagraph();
oParagraph.AddText("Best regards,");
oParagraph.AddLineBreak();
oParagraph.AddText("ONLYOFFICE Document Builder Team");
oParagraph.AddText("中文内容");
oDocument.Push(oParagraph);
builder.SaveFile("docx", "SampleText.docx");
builder.CloseFile();

I meant that extension you are using is not .docbuilder. Even though it should work, I recommend using .docbuilder only.

Also, I failed to note that PowerShell is used instead of Command Prompt, sorry. Since these are quite different operators, to set up variable in PowerShell you need to execute it as follows:

$env:V8_USE_INSPECTOR = "1"

And then call the builder:

.\docbuilder.exe .\test.docbuilder

It works ! thanks, it will helpful to me!

1 Like

I’m glad the the situation was resolved.