Skip to content

[ERROR] Secure random number generation... #5

Closed

Description

I want to format the following template but I get this error in the jsonResult (res) object at the time of making the json.Unmarshal (mjml.go line 204)

Template:
<mjml> <mj-body background-color="#fff"> <mj-section background-color="#ef6451"> <mj-column> <mj-navbar base-url="https://link.com" hamburger="hamburger" ico-color="#ffffff"> <mj-navbar-link href="#" color="#ffffff">Nav1</mj-navbar-link> <mj-navbar-link href="#" color="#ffffff">Nav2</mj-navbar-link> <mj-navbar-link href="#" color="#ffffff">Nav3</mj-navbar-link> <mj-navbar-link href="#" color="#ffffff">Nav4</mj-navbar-link> <mj-navbar-link href="#" color="#ffffff">Nav5</mj-navbar-link> </mj-navbar> </mj-column> </mj-section> <mj-section full-width="full-width"> <mj-column> <mj-text align="center" font-size="20px"> {{ title }} </mj-text> </mj-column> </mj-section> <mj-section> <mj-column> <mj-button font-family="Helvetica" background-color="#f45e43" color="white"> Button 1 </mj-button> </mj-column> <mj-column> <mj-button font-family="Helvetica" background-color="#f45e43" color="white"> Button 2 </mj-button> </mj-column> <mj-column> <mj-button font-family="Helvetica" background-color="#f45e43" color="white"> Button 3 </mj-button> </mj-column> </mj-section> </mj-body> </mjml>

Err: Secure random number generation is not supported by this browser. Use Chrome, Firefox or Internet Explorer 11

Im using a IDE to test it and go 1.18.2.
I execute the method with these options:
mjml.ToHTML(context.Background(), stringTemplate, mjml.WithFonts(mjml.Fonts{}), mjml.WithBeautify(true), mjml.WithMinify(true), mjml.WithValidationLevel("skip"))

After several tests I know that the error comes from the section that includes the navbar, it only happens when the navbar is added.

Template in online editor

Any recommendations? Is this a limitation of the package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions