Home Forums Chart Support When running puppeteer, cannot access local version of CanvasJS source

When running puppeteer, cannot access local version of CanvasJS source

Viewing 3 posts - 1 through 3 (of 3 total)
  • #43722

    I can display a simple chart rendered by CanvasJS not directly in a browser, but from a small node.js program which runs puppeteer (which runs its own version of the Chrome browser).

    This is successful. I can see the Chrome browser displaying the chart, and it happily saves the image locally to the browser, which is what I want.

    However, this is only successful when the html file accesses the CanvasJS source code from the CDN of the trial version on the web.

    If I change accessing the source code to my licensed local copy of CanvasJS source (version v3.7.19 GA), the browser will not display the chart. It shows errors when trying to access the CanvasJS source.

    I supplied a One-Drive Link with the code (3 small files of code), without the CanvasJS source and without the puppeteer modules. There is also a ReadMeToUnderstandProblem.txt text file to explain the problem in more detail.

    I have added a link as “CanvasJS Puppeteer Issue”, https://1drv.ms/f/s!AtwGGXXE6rdQjeMIKfqRQ-c7zy1T3Q?e=yH0S5hPuppeteer Local Access Issue

    #43736

    Graham,

    While using the trial version of CanvasJS, the script is being served from a server, however, while integrating the commercial version, it’s not.

    Serving the script file from the server seems to be working fine. Please check the code snippet below which uses Express to serve CanvasJS from a server:

    //demo_ServeCsv.js
    
    var express = require("express");
    var app = express();
    
    app.get("/", function (request, response) {     
      response.sendFile(__dirname + "/demo_traffic_chart.html"); 
    });
    
    app.get("/canvasjs.min.js", function (request, response) {     
      response.sendFile(__dirname + "/canvasjs.min.js"); 
    }); 
    
    app.listen(8000);  
    
    console.log("Check out http://localhost:8000");


    Thangaraj Raman
    Team CanvasJS

    #43810

    Thanks, Thangaraj! I’ve only just seen your response. Such a simple solution, and attended so quickly.
    Regards

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.