Our state of the art Gantt chart


Post by jim@jimclark.net.au »

Hi

Just running the \gantt-2.0.1\examples\_shared\server and
gantt-2.0.1\examples\vue\javascript\pdf-export
but cannot get past this error:

Access to fetch at 'https://localhost:8080/' from origin 'https://localhost:8081' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Am using vue cli 4.1.1
node: 12.14.0
Google Chrome browser.

Post by jim@jimclark.net.au »

same problem on linux, cannot get the example shared server working with pdf-export on windows or linux. tried the angular and vue versions of pdf-export. It almost works if I connect the print server you are using on the live demo (ie. https://dev.bryntum.com:8082). Does not have the cors/preflight issue. What is difference between the code base for that https://dev.bryntum.com:8082 version of the print server and the one you have in _shared?

Post by Maxim Gorkovsky »

Hello.
When page loaded from https://localhost:8080 says that request to https://localhost:8081 has been blocked by CORS policy, it means that response from localhost:8081 came without special header which would allow localhost:8080 to use resources from localhost:8081. My guess is that you have started server with -c option and provided wrong origin, probably without scheme (read more about origin here):
./server

    Usage: ./server [OPTION]

      -h, --http=PORT            Start http server on port
      -H, --https=PORT           Start https server on port
      -w, --websocket=PORT       Start websocket server on port
      -W, --securewebsocket=PORT Start secure websocket server on port
      -c, --cors=HOST            CORS origin, default value "*". Set to "false" to disable CORS.
      -m, --maximum=SIZE         Maximum upload size (default 50mb)
      -r, --resources=PATH       The absolute path to the resource directory. This path will be accessible via the webserver.
          --no-sandbox           Chromium no-sandbox argument
          
You need to either start server without -c option, or set it accordingly:
./server -c https://localhost:8080

Post by jim@jimclark.net.au »

Thanks for feedback.
all fixed.
need -c and -r
node src/server.js -w 8080 -r '/webcomponents/resources'
Last edited by jim@jimclark.net.au on Mon Jan 20, 2020 10:38 am, edited 1 time in total.

Post by Maxim Gorkovsky »

pdf-export does not get past the Loading stage
What do you mean exactly? Are you using multipage exporter or single page?
Export server is very slow at this stage when using multipage exporter (about 2 seconds per page) and we are working to improve performance. We are rushing to make it available in the next release.
Single page exporter should be much faster (as fast as puppeteer is able to generate PDF)

Post by jim@jimclark.net.au »

Correction: Not fixed.
have a look at this screen shot. https://download.jimclark.net.au/ExportStuckOnloading.png
as you can see it never post to print server and never makes any progress (waited some minutes).
It is a single page export, basically run standard demo and click export.

am running the server from...
node src/server.js -w 8080 -c https://localhost:8080
which gets past the cors problem
Do I need to specify the location of the resources as well?
Is this from gantt-2.0.1\examples\webcomponents\resources?

Post by jim@jimclark.net.au »

Can give you a teamviewer connection if you like?

Post by jim@jimclark.net.au »

The gantt-1.3.0-beta-1-trial used to work OK but trial has expired and cannot use it anymore.

Post by Maxim Gorkovsky »

node src/server.js -w 8080 -c https://localhost:8080
It is not stated directly in the readmes that export feature doesn't yet support websocket connection to the server, but all readmes recommend to use http connection. I have opened a ticket about this: https://github.com/bryntum/support/issues/212
With this line it should work:
node src/server.js -h 8080 -c https://localhost:8080
Sorry for inconvenience.

Post by Maxim Gorkovsky »

jim@jimclark.net.au wrote: Mon Jan 20, 2020 1:08 pm The gantt-1.3.0-beta-1-trial used to work OK but trial has expired and cannot use it anymore.
As I understand, you have a license for Bryntum Gantt. You can get latest release from the customer zone.

Post Reply