gmpassos / dom_builder

Helpers to generate DOM elements or HTML
BSD 3-Clause "New" or "Revised" License
7 stars 2 forks source link

Examples Not Working #8

Open jtkeyva opened 2 weeks ago

jtkeyva commented 2 weeks ago

I really want to try this out but the examples only have a couple dart files in there and I am getting a blank white screen if I try to run them.

Terminal is showing: A message on the flutter/lifecycle channel was discarded before it could be handled. This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded: https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html

Console is showing:

is deprecated. Please include dom.dart:184 Rejecting promise with error: TypeError: Cannot set properties of undefined (setting 'nativeCommunication') DomConsoleExtension$124warn @ dom.dart:184 (anonymous) @ dom.dart:184 (anonymous) @ js_promise.dart:29 runUnary @ zone.dart:1661 handleError @ future_impl.dart:181 handleError @ future_impl.dart:873 _propagateToListeners @ future_impl.dart:894 [_completeError] @ future_impl.dart:674 (anonymous) @ future_impl.dart:760 _microtaskLoop @ schedule_microtask.dart:40 _startMicrotaskLoop @ schedule_microtask.dart:49 (anonymous) @ async_patch.dart:181 Promise.then _scheduleImmediateWithPromise @ async_patch.dart:179 _scheduleImmediate @ async_patch.dart:151 _scheduleAsyncCallback @ schedule_microtask.dart:69 _rootScheduleMicrotask @ zone.dart:1466 scheduleMicrotask @ zone.dart:1681 [_asyncCompleteError] @ future_impl.dart:759 _asyncCompleteWithErrorCallback @ future.dart:1360 runBody @ async_patch.dart:121 _async @ async_patch.dart:127 (anonymous) @ initialization.dart:35 (anonymous) @ app_bootstrap.dart:57 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 (anonymous) @ app_bootstrap.dart:56 (anonymous) @ js_loader.dart:74 _callDartFunctionFast1 @ js_allow_interop_patch.dart:192 ret @ js_allow_interop_patch.dart:81 (anonymous) @ (index):52 Promise.then onEntrypointLoaded @ (index):51 didCreateEngineInitializer @ flutter.js:1 bootstrapEngine @ initialization.dart:52 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 bootstrapEngine @ initialization.dart:27 main @ web_entrypoint.dart:19 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 main @ web_entrypoint.dart:18 (anonymous) @ main_module.bootstrap.js:23 window.$dartRunMain @ main_module.bootstrap.js:22 (anonymous) @ VM839:1 runMain @ client.js:9920 (anonymous) @ client.js:26065 (anonymous) @ client.js:4058 call$2 @ client.js:12409 _asyncStartSync @ client.js:4022 $call$body$mainclosure @ client.js:26081 call$1 @ client.js:25994 _rootRunUnary @ client.js:4437 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 _sendData$1 @ client.js:13344 _add$1 @ client.js:13290 _add$1 @ client.js:13625 _handleData$2 @ client.js:13688 _handleData$1 @ client.js:13651 (anonymous) @ client.js:1780 _rootRunUnary @ client.js:4437 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 _sendData$1 @ client.js:13344 _add$1 @ client.js:13290 _sendData$1 @ client.js:13136 add$1 @ client.js:13015 (anonymous) @ client.js:1835 _rootRunUnary @ client.js:4437 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 _sendData$1 @ client.js:13344 _add$1 @ client.js:13290 _sendData$1 @ client.js:13136 add$1 @ client.js:13015 add$1 @ client.js:25344 _innerListen$1 @ client.js:25680 (anonymous) @ client.js:1780 call$1 @ client.js:25629 _rootRunUnary @ client.js:4441 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 call$1 @ client.js:13941 Primitives_applyFunction @ client.js:1346 Function_apply @ client.js:5969 _callDartFunctionFast @ client.js:8353 (anonymous) @ client.js:8344 js_promise.dart:30 Uncaught (in promise) null (anonymous) @ js_promise.dart:30 runUnary @ zone.dart:1661 handleError @ future_impl.dart:181 handleError @ future_impl.dart:873 _propagateToListeners @ future_impl.dart:894 [_completeError] @ future_impl.dart:674 (anonymous) @ future_impl.dart:760 _microtaskLoop @ schedule_microtask.dart:40 _startMicrotaskLoop @ schedule_microtask.dart:49 (anonymous) @ async_patch.dart:181 Promise.then _scheduleImmediateWithPromise @ async_patch.dart:179 _scheduleImmediate @ async_patch.dart:151 _scheduleAsyncCallback @ schedule_microtask.dart:69 _rootScheduleMicrotask @ zone.dart:1466 scheduleMicrotask @ zone.dart:1681 [_asyncCompleteError] @ future_impl.dart:759 _asyncCompleteWithErrorCallback @ future.dart:1360 runBody @ async_patch.dart:121 _async @ async_patch.dart:127 (anonymous) @ initialization.dart:35 (anonymous) @ app_bootstrap.dart:57 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 (anonymous) @ app_bootstrap.dart:56 (anonymous) @ js_loader.dart:74 _callDartFunctionFast1 @ js_allow_interop_patch.dart:192 ret @ js_allow_interop_patch.dart:81 (anonymous) @ (index):52 Promise.then onEntrypointLoaded @ (index):51 didCreateEngineInitializer @ flutter.js:1 bootstrapEngine @ initialization.dart:52 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 bootstrapEngine @ initialization.dart:27 main @ web_entrypoint.dart:19 runBody @ async_patch.dart:84 _async @ async_patch.dart:127 main @ web_entrypoint.dart:18 (anonymous) @ main_module.bootstrap.js:23 window.$dartRunMain @ main_module.bootstrap.js:22 (anonymous) @ VM839:1 runMain @ client.js:9920 (anonymous) @ client.js:26065 (anonymous) @ client.js:4058 call$2 @ client.js:12409 _asyncStartSync @ client.js:4022 $call$body$mainclosure @ client.js:26081 call$1 @ client.js:25994 _rootRunUnary @ client.js:4437 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 _sendData$1 @ client.js:13344 _add$1 @ client.js:13290 _add$1 @ client.js:13625 _handleData$2 @ client.js:13688 _handleData$1 @ client.js:13651 (anonymous) @ client.js:1780 _rootRunUnary @ client.js:4437 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 _sendData$1 @ client.js:13344 _add$1 @ client.js:13290 _sendData$1 @ client.js:13136 add$1 @ client.js:13015 (anonymous) @ client.js:1835 _rootRunUnary @ client.js:4437 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 _sendData$1 @ client.js:13344 _add$1 @ client.js:13290 _sendData$1 @ client.js:13136 add$1 @ client.js:13015 add$1 @ client.js:25344 _innerListen$1 @ client.js:25680 (anonymous) @ client.js:1780 call$1 @ client.js:25629 _rootRunUnary @ client.js:4441 runUnary$2$2 @ client.js:13804 runUnaryGuarded$1$2 @ client.js:13751 call$1 @ client.js:13941 Primitives_applyFunction @ client.js:1346 Function_apply @ client.js:5969 _callDartFunctionFast @ client.js:8353 (anonymous) @ client.js:8344 js_primitives.dart:28 A message on the flutter/lifecycle channel was discarded before it could be handled. This happens when a plugin sends messages to the framework side before the framework has had an opportunity to register a listener. See the ChannelBuffers API documentation for details on how to configure the channel to expect more messages, or to expect messages to get discarded: https://api.flutter.dev/flutter/dart-ui/ChannelBuffers-class.html

gmpassos commented 2 weeks ago

Without any code, it's impossible to understand what you are doing.

jtkeyva commented 2 weeks ago

Just trying to run your examples :)

gmpassos commented 2 weeks ago

I have just run it:

➜ dom_builder git:(master) ✗ dart run example/dom_builder_example.dart

===============
<div class="container">
  <span id="s1">The </span>
  <span id="s2" style="font-weight: bold">DOM </span>
  <span>Builder</span>
  <table>
    <thead>
      <tr>
        <th>Name</th>
        <th>Age</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>Smith</td>
        <td>30</td>
      </tr>
      <tr>
        <td>Joe</td>
        <td>21</td>
      </tr>
    </tbody>
  </table>
</div>
===============
eq: true
gmpassos commented 2 weeks ago

Note that probably you are trying to run it inside a Flutter project, and you shouldn't import dart:html.

jtkeyva commented 2 weeks ago

ok thanks! i am under the understanding this should be a flutter project though ya? like this will be the Web portion of my flutter cross-platform app and this will help render the dom and help with SEO. Honestly I'm a bit confused as to what this package is capable of and how it works