Code Monkey home page Code Monkey logo

Comments (5)

HerringtonDarkholme avatar HerringtonDarkholme commented on June 13, 2024

Have you ever tried debug it yourself? For example test it in Chrome to reproduce it?

from av-ts.

DorianGrey avatar DorianGrey commented on June 13, 2024

I've tried, yes - but it gave even less useful results.
In Chrome (Chromium in my case) and electron, no tests even got executed - the task just fails with code 1:


Finished in 0.004 secs / 0 secs @ 10:27:09 GMT+0200 (CEST)

SUMMARY:
✔ 0 tests completed

=============================== Coverage summary ===============================
Statements   : 100% ( 0/0 )
Branches     : 100% ( 0/0 )
Functions    : 100% ( 0/0 )
Lines        : 100% ( 0/0 )
================================================================================
10 07 2017 10:27:09.783:DEBUG [karma]: Run complete, exiting.
10 07 2017 10:27:09.784:DEBUG [launcher]: Disconnecting all browsers
10 07 2017 10:27:09.791:DEBUG [coverage]: Writing coverage to /home/linne/Projects/vue-ts-playground/test-results/coverage
10 07 2017 10:27:09.855:DEBUG [reporter.junit]: JUnit results written to "/home/linne/Projects/vue-ts-playground/test-results/junit/TESTS-Chromium_58.0.3029_(Ubuntu_0.0.0).xml".
10 07 2017 10:27:09.887:DEBUG [launcher]: Process Chromium exited with code 0
10 07 2017 10:27:09.887:DEBUG [temp-dir]: Cleaning temp dir /tmp/karma-29324556
10 07 2017 10:27:09.901:DEBUG [launcher]: Finished all browsers
error Command failed with exit code 1.

The only message I could pick up from the browser console was this:

Refused to execute script from 'http://localhost:9876/base/index.ts' because its MIME type ('video/mp2t') is not executable.

Which seems to be quite reasonable - considering that the preprocessor failed before (as the message from phantomjs mentioned), the browser attempts to load something it cannot deal with, and refuses to go ahead.
The same happens in firefox.

Considering the error message from phantomjs, it seems to have something to do with the decorate function from the Component decorator, which was changed since 0.7.2 in this commit.
I'm a bit confused here - the content from the npm package of 0.8.2 does not seem to match the source.
The core.js in the package looks like this:

 function decorate(cls) {
     Component.inDefinition = true;
     cls.prototype._init = util_1.NOOP;
     var instance = null;
     try {
         instance = new cls();
     }
     finally {
         Component.inDefinition = false;
     }
     delete cls.prototype._init;
     var proto = cls.prototype;
     var options = makeOptionsFromMeta(meta, cls['name']);
     var _a = getKeys(proto), internalKeys = _a.internalKeys, normalKeys = _a.normalKeys;
     for (var _i = 0, internalKeys_1 = internalKeys; _i < internalKeys_1.length; _i++) {
         var protoKey = internalKeys_1[_i];
         collectInternalProp(protoKey, proto, instance, options);
     }
     for (var _b = 0, normalKeys_1 = normalKeys; _b < normalKeys_1.length; _b++) {
         var protoKey = normalKeys_1[_b];
         collectMethodsAndComputed(protoKey, proto, options);
     }
     // everything on instance is packed into data
     collectData(cls, Object.keys(instance), options);
     var Super = findSuper(proto);
     return Super.extend(options);
 }

While the source code (since the referenced change) performs some more steps after the findSuper line.

As I mentioned, the tests executed fine with 0.7.2., and 0.8.2 still works for and both for dev and build tasks. I'm not sure where to go ahead from here.

from av-ts.

HerringtonDarkholme avatar HerringtonDarkholme commented on June 13, 2024

The error stack is unreadable.
Please consider finding out some meaningful error message.

The possible cause is adding static methods to constructor. But I cannot reproduce. You can try delete those lines in node_module.

from av-ts.

HerringtonDarkholme avatar HerringtonDarkholme commented on June 13, 2024

This is phantom specific bug. Assigning arguments and caller will cause, well, a TypeError without any useful information.

I won't fix it for a platform where the author has abdicated maintenance.

from av-ts.

DorianGrey avatar DorianGrey commented on June 13, 2024

Hm... sounds reasonable. I've debugged things down a bit and was wondering why both cls['arguments'] and ret['arguments'] raised a TypeError here. I'm not the biggest fan of Phantomjs, just picked it up because it was mentioned as "recommended" in the vue template.
I'll try to go with Electron in this case, or give Jest a shot.

Anyway, thanks for taking a closer look at this issue!

from av-ts.

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.