Skip to content

Error using alpinejs-ray via CDN #205

Description

@bnzo

Description

Unable to use alpinejs-ray via CDN shows the following error in the web inspector:

TypeError: Cannot read properties of undefined (reading 'randomUUID')

Steps To Reproduce

  1. Using the following file:
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/axios@latest/dist/axios.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/alpinejs-ray@2/dist/standalone.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/alpinejs@3/dist/cdn.min.js" defer></script>
</head>

<body>
    <div x-data>
        <button @click="$ray('hello from alpine')">Send to Ray</button>
    </div>
</body>

</html>
  1. Open it and click on Send to ray
  2. See the following screenshot of the web inspector
Screenshot 2024-06-30 at 15 06 06

Expected behavior

The web page should not have any errors and should communicate with Ray

Environment

  • OS: macOS 14.5
  • Browser: Chrome 126.0.6478.127 (Official Build) (arm64)

Additional context

Setting up a project with alpinejs-ray installed via npm works correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions