Code Monkey home page Code Monkey logo

Comments (6)

rodja avatar rodja commented on May 16, 2024

The integration went quite well and easy. But now I've run into a blocker: Elements like ui.scene, ui.keyboard and ui.joystick are not working correctly on the GitHub Action. Locally they pass as expected. On GitHub instead of the expected template from their Vue components they just appear as elements like <keyboard></keyboard> or <joystick></joystick> without any functionality.

from nicegui.

falkoschindler avatar falkoschindler commented on May 16, 2024

Might be a routing issue for their dependencies. If, e.g., keyboard.js is not found, a keyboard element will only insert <keyboard></keyboard> in the DOM.

from nicegui.

rodja avatar rodja commented on May 16, 2024

Very good, @falkoschindler. It seems that somehow the component response is wrapped in a html container. If I query /keyboard.js it returns

<html>
 <head>
  <meta content="light dark" name="color-scheme"/>
 </head>
 <body>
  <pre style="word-wrap: break-word; white-space: pre-wrap;">Vue.component("keyboard", {
  template: `&lt;span data-nicegui='keyboard' v-bind:id="jp_props.id" :class="jp_props.classes" :style="jp_props.style"&gt;&lt;/span&gt;`,
  mounted() {....

instead of the expected

Vue.component("keyboard", {
  template: `&lt;span data-nicegui='keyboard' v-bind:id="jp_props.id" :class="jp_props.classes" :style="jp_props.style"&gt;&lt;/span&gt;`,
  mounted() {....

from nicegui.

rodja avatar rodja commented on May 16, 2024

No! The above observation is incorrect. The "wrapping" happend because I used BeautifulSoup to display the content. ::facepalm::

I verified with the "requests" lib that /keyboard.js indeed delivers the Vue component as expected. After I got the javascript console from Selenium to show up in the logs, the error is obvious:

http://localhost:3392/static/keyboard.js - Failed to load resource: the server responded with a status of 404 (Not Found)

But why is the component accessed via /static instead of /?

from nicegui.

rodja avatar rodja commented on May 16, 2024

I finally found the problem: run.py imported globals.py before setting the template directory. But globals.py imported justpy for type annotations. Therefore justpy setted its directories before we could modify them as necessary. Fixed in 4fd338b.

from nicegui.

rodja avatar rodja commented on May 16, 2024

All green :-)

from nicegui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.