Skip to content

Live preview onclick event fails as a blitz, but works in bolt.new #1770

@selfcommit

Description

@selfcommit

Describe the bug

On click of this example button:

Image

The follow error message returns:
Image

Something about the live preview in StackBlitz seems to want valid JSON.
Interestingly, this same code runs without issue inside of bolt.new

Link to the blitz that caused the error

https://stackblitz.com/edit/sb1-sptuktul?file=index.html,tsconfig.node.json

Steps to reproduce

  1. Navigate to a same project with an onclick button (Example: https://stackblitz.com/edit/sb1-sptuktul?file=index.html,tsconfig.node.json)
  2. Open the preview mode, and click the button
  3. The button event will fail, with an error in the js console.

Expected behavior

The onclick function should be able to render the event without error.

Parity with Local

Screenshots

Image

Platform

Browser name  = Chrome
Full version  = 134.0.0.0
Major version = 134
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 134952544,
  "usedJSHeapSize": 115767592,
  "jsHeapSizeLimit": 4294705152
}
Hash = 495c5120

Additional context

No response

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