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

Local DartPad UI unable to reach local backend #3054

Open
craiglabenz opened this issue Sep 10, 2024 · 1 comment
Open

Local DartPad UI unable to reach local backend #3054

craiglabenz opened this issue Sep 10, 2024 · 1 comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@craiglabenz
Copy link
Contributor

craiglabenz commented Sep 10, 2024

What happened?

I tried to run DartPad locally to test the addition of a new dependency, but the frontend (in Chrome) is unable to reach the backend on account of a security error.

Steps to reproduce problem

Terminal 1

$ cd pkgs/dart_services && dart bin/server.dart 

Terminal 2

$ cd pkgs/dartpad_ui && * flutter run -d chrome --web-browser-flag "--disable-web-security"

Then in Chrome once it launches, I clicked > Run and saw this error:

rtti.dart:114 Uncaught (in promise) SecurityError: Blocked a frame with origin "http://localhost:60142" from accessing a cross-origin frame.
    at hasOwnProperty (<anonymous>)
    at Object.getInterceptorForRti (rtti.dart:114:37)
    at dart_rti.Rti.new._isTestViaProperty (rti.dart:1332:21)
    at dart_rti.Rti.new._generalAsCheckImplementation (rti.dart:1382:34)
    at Object.JSObjectUnsafeUtilExtension$124getProperty [as JSObjectUnsafeUtilExtension|getProperty] (js_interop_unsafe_patch.dart:20:7)
    at Object.HTMLIFrameElementExtension$124safelyPostMessage [as HTMLIFrameElementExtension|safelyPostMessage] (frame_utils.dart:27:10)
    at [_send] (frame.dart:142:12)
    at frame.dart:35:12
    at async_patch.dart:603:19
    at async_patch.dart:627:23
    at async_patch.dart:574:31
    at _RootZone.runUnary (zone.dart:1661:54)
    at async._FutureListener.thenAwait.handleValue (future_impl.dart:163:18)
    at handleValueCallback (future_impl.dart:861:44)
    at _Future._propagateToListeners (future_impl.dart:890:13)
    at [_completeWithValue] (future_impl.dart:666:5)
    at future_impl.dart:966:16
    at _RootZone.runUnary (zone.dart:1661:54)
    at async._FutureListener.then.handleValue (future_impl.dart:163:18)
    at handleValueCallback (future_impl.dart:861:44)
    at _Future._propagateToListeners (future_impl.dart:890:13)
    at [_completeWithValue] (future_impl.dart:666:5)
    at async._AsyncCallbackEntry.new.callback (future_impl.dart:736:7)
    at Object._microtaskLoop (schedule_microtask.dart:40:11)
    at _startMicrotaskLoop (schedule_microtask.dart:49:5)
    at async_patch.dart:179:7

Additional info

Browser

Browser: Chrome

Version: 128.0.6613.120 (Official Build) (arm64)

Are you using any extensions/plugins that affect website behavior
(particularly those that affect iframes, such as ad blockers)?

No.

Machine

Operating system: macOS

Version: Sonoma 14.6.1 (23G93)

Your code

I encountered this issue while attempting to manually test #3053

DartPad's output

See error above.

@johnpryan
Copy link
Contributor

cc: @devoncarew @parlough

@johnpryan johnpryan added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) P1 A high priority bug; for example, a single project is unusable or has many test failures labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants