Custom Activity Development Server Error
I'm following the guide for developing custom activities https://developers.vertigisstudio.com/docs/workflow/sdk-web-overview/, but get the following error when workflow designer tries to load the activity pack from my local machine (registered with Portal as per the guide):
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at ‘https://localhost:5000/activitypack.json/index.js.map’. (Reason: Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’).
Anyone else having this problem?
-
I've tried deploying the activity to an IIS server, but I'm getting a 404 (Not found) on /activitypack.json/index.js.map. Not sure where 'index.js.map' is coming from, as the request from workflow designer doesn't look right.
0 -
Hi Jerry,
There are two flavors of the Workflow SDK. The old version uses the "index.js.map" files. The new version (the one that you are using) produces an "activitypack.json" file.
Since your Workflow designer is appending "index.js.map" to the request it means designer thinks that it is the old style. This suggests that one of the following is the cause:
- You are using an on-prem version of Workflow older than 5.18. Support for the new SDK was added at 5.18. You'll need to upgrade to 5.18 or newer.
- The URL on the activity pack portal item does not end with exactly "/activitypack.json". This is how the designer distinguishes between the two styles of SDK.
0 -
Hi @Ryan Cooney? ,
Thanks for you response. Yes, the issue was an older version of Workflow. After upgrading to 5.18.1 the activities on IIS appear in the workflow activity panel, and work as expected.
However, the activity pack hosted on the 'dev' server (https://localhost:5000), still shows the CORS issue. I'm guessing this is due to the fact that workflow designer of hosted on a different machine. Are there any flags I can pass to the dev server, to include a list of allowed origins?
Thanks,
Jerry
0 -
Hi @Ryan Cooney? ,
Any suggestions for "activity pack hosted on the 'dev' server (https://localhost:5000), still shows the CORS issue. I'm guessing this is due to the fact that workflow designer of hosted on a different machine. Are there any flags I can pass to the dev server, to include a list of allowed origins?"
What's the development workflow, when developing on my local machine and running the activities on remote servers? Building and deploying to the server takes time and the code is minified, which is impossible to debug.
Thanks,
Jerry
0 -
Hi Jerry,
I have a workaround for you.
- Open node_modules\@vertigis\workflow-sdk\scripts\start.js
- Edit line 31 that currently says "Access-Control-Allow-Origin": "*"
- Change the "*" to be the root URL of the server where your workflow designer is running. Something like: "https://acme.apps.geocortex.com" or "https://myserver.com".
Normally you should never edit files within node_modules. But this should just be a temporary fix. We have a change coming in the next Workflow release that resolves this issue.
--Ryan
1 -
Thank you @Ryan Cooney? :)
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
6 Kommentare