Skip to content

"Quickly Try JSX" does not work on a local file #2038

Description

@funmibifashina

In Docs > Installation > Add React to a Website > Optional : Try React with JSX > Quickly Try JSX, the instructions say:

...add this <script> tag to your page:

<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>

Now you can use JSX in any <script> tag by adding type="text/babel" attribute to it.

However, after adding these lines to a local HTML file, opening it in browser gives the following error:

Access to XMLHttpRequest at 'file:///C:/Users/.../like_button.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Metadata

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