Coder Social home page Coder Social logo

I was not able to run example about qmlweb HOT 9 CLOSED

bessorion avatar bessorion commented on June 11, 2024
I was not able to run example

from qmlweb.

Comments (9)

bessorion avatar bessorion commented on June 11, 2024

In addition, lib-folder from npm package was able to run example app, but I suppose master-version supports more default qml components. Am I right?
Again, could you help me run at least example on last sources? I have to port existing qt-qml app to the web and going to use your library instead of rewriting the whole app on Angular if it's possible.

from qmlweb.

bessorion avatar bessorion commented on June 11, 2024

I receive the same error when I try to run npm i && npm run coverage :
Uncaught TypeError: Super expression must either be null or a function, not undefined at tmp/qmlweb.covered.js:125228
It looks like new module syntax and ./builder/shaker.js script doesn't normalize classes sequence by dependencies, so QmlWeb_Dom_DomElement defined earlier than its parent QtQuick_Item. To make sure you can take a look into newly built qmlweb.js file

from qmlweb.

ChALkeR avatar ChALkeR commented on June 11, 2024

Hi! Sorry for the delayed response, looking at it.

from qmlweb.

ChALkeR avatar ChALkeR commented on June 11, 2024

Thanks for the report and the investigation.

npm i && npm run coverage works for me and the log doesn't have anything about Super.
Which Node.js verson are you using?
Have you done any modifications?

Could you try cloning into a clean dir again and re-running npm i && npm run coverage from it?
Also, the line numbers in tmp/qmlweb.covered.js don't seem to match — mine is column: 8 on that line.

It looks like new module syntax

That should be processed with babel. The TypeError could be thrown from babel, but not sure why.

./builder/shaker.js script doesn't normalize classes sequence by dependencies

A possible explanation is that the class order is incorrect for some reason…
Could you do grep -E '^\s\sfunction\s' tmp/qmlweb.covered.js and attach here or to a gist, please?
Alternatively, attaching the whole file would also do.

from qmlweb.

bessorion avatar bessorion commented on June 11, 2024

I'm so happy you've finally answered )
I'm afraid I cannot use grep on windows, so I'll attach the whole file.

tmp.zip

C:\Users\BeSSoRioN\Documents\GitHub\qmlweb>node --version
v8.11.1

I tried to build and run clean repo from github, so I suppose no changes was performed exclude node_modules folder

Please let me know if you need something else

from qmlweb.

bessorion avatar bessorion commented on June 11, 2024

I searched through the file and the same initialization order I'd seen during debug procedure with firebug: some base classes was instantiated normally (placed in ./src/qtbase and ./src/engine), then QmlWeb_Dom_DomElement throws exception (why is it the first from ./src/modules ?)

from qmlweb.

ChALkeR avatar ChALkeR commented on June 11, 2024

Yes, I can confirm that the order is indeed incorrect in your build. Thanks for that file!

I reproduced the build that you have, and I suppose that the error is somewhere somewhere along this line: https://github.com/qmlweb/qmlweb/blob/master/builder/shaker.js#L50, i.e. my guess would be that relative.startsWith(prefix) always fails on Windows. Could be caused by different path normalization, looking at it.

from qmlweb.

ChALkeR avatar ChALkeR commented on June 11, 2024

@bessorion See #433.

Try testing windows-shaker branch — check it out, remove lib and tmp dirs (just in case) and re-run.
I believe it contains a fix.

Alternatively, you could try replacing require("path") with require("path").posix in shaker.js.

from qmlweb.

bessorion avatar bessorion commented on June 11, 2024

Current problem seems to be fixed. At least I have no more errors during library loading. You can merge windows-shaker branch to the master.
Unfortunately, I still have many problems with my existing qml-app sources.
Will provide information little bit later

from qmlweb.

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.