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

Docker instance crashes when creating a JsBarcode push to Canvas (Error code 139) #417

Open
MannequinBanshee opened this issue Sep 29, 2022 · 0 comments

Comments

@MannequinBanshee
Copy link

"jsbarcode": "^3.11.5",

I am getting an error when trying to create a new bar code and save it.
The below code works perfectly when running it outside of a docker container.

You can check out the Docker Hub container mannequinbanshee/pointofsale:latest for reference to the setup:

link to docker

   const CreateSingleBarcode = async (req,h) => {

    var BarcodeCanvas = createCanvas();
    var guid = uuid.v1().substring(0,8);
    try{
        **JsBarcode(BarcodeCanvas,guid);**   ## code crashes here with exited with code 139
        var CreatedBarcode = await Barcode.create({"name": guid});
        var canvasData = BarcodeCanvas.toBuffer("image/png");
        var ServerSidePath = Path.join(__dirname,"../../../../static/public/assets/images/Barcodes");
        if(fs.existsSync(ServerSidePath)){
          var success = await fs.writeFile(`${ServerSidePath}/${guid}.png`,canvasData,(error) => {
            if(error){
                winston.error(error.message);
            }
          });
        }
    }
    catch(e){
        winston.error(e.message);
    }


    return guid;
    }

The Below image shows the new button which is linked to the above.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant