Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Pathing Issues in the Workflow-Standalone Example #1101

Closed
haydar-metin opened this issue Aug 30, 2023 · 2 comments · Fixed by eclipse-glsp/glsp-server-node#55
Closed
Assignees
Labels
bug Something isn't working client server-node

Comments

@haydar-metin
Copy link

haydar-metin commented Aug 30, 2023

The server can not open the example1.wf file in the Workflow-Standalone Example on Windows:

Log:

// yarn start:exampleServer
...
15:41:15 error -  [WorkflowGLSPServer] Could not process action: 'requestModel
15:41:15 error -  [WorkflowGLSPServer] Error: Could not load model from file: /C:/Users/.../glsp-client/examples/workflow-standalone/app/example1.wf

It works again after removing the / in the examplePath used in https://github.com/eclipse-glsp/glsp-client/blob/master/examples/workflow-standalone/src/app.ts#L37 by hardcoding the URI in https://github.com/eclipse-glsp/glsp-client/blob/master/examples/workflow-standalone/src/app.ts#L49:

container = createContainer({ clientId, diagramType, glspClientProvider: async () => glspClient, sourceUri: 'C:/Users/.../glsp-client/examples/workflow-standalone/app/example1.wf' });

OS: Windows 10
Node: 16.19.1

@haydar-metin haydar-metin added the bug Something isn't working label Aug 30, 2023
@planger
Copy link
Member

planger commented Aug 30, 2023

Thanks for reporting this issue! It would also be interesting to know, if this only happens with the node-based server or also with the Java-based server.

@tortmayr
Copy link
Contributor

tortmayr commented Sep 4, 2023

Tested this, and the issue only appears with the node implementation. In the Java variant we convert the received url into a new File object. This seems to take care of proper path conversion (i.e. removal of leading slashes under Windows).
For the node-serer we don't have the same functionality. We use the fileUrlToPath` utility function, but that does not consider leading slashes. So we have to handle them manually.

tortmayr added a commit to eclipse-glsp/glsp-server-node that referenced this issue Sep 4, 2023
Ensure leading shashes in File urls are properly handled under Windows.
Also: Fix rimraf command that was not working under Windows
Fixes eclipse-glsp/glsp#1101
@tortmayr tortmayr self-assigned this Sep 4, 2023
tortmayr added a commit to eclipse-glsp/glsp-server-node that referenced this issue Sep 4, 2023
Ensure leading shashes in File urls are properly handled under Windows.
Also: Fix rimraf command that was not working under Windows
Fixes eclipse-glsp/glsp#1101
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client server-node
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants