alexlafroscia / ember-steps

Declaratively create wizards, tabbed UIs, and more
https://alexlafroscia.github.io/ember-steps
MIT License
90 stars 23 forks source link

Rendering ember-steps throws `Uncaught TypeError: Cannot read property 'isDescriptor' of undefined` #151

Closed glyoko closed 5 years ago

glyoko commented 5 years ago

I'm using the latest Ember version (3.10.1) and have been using an old version of ember-steps (2.3.1) for a long time. I recently tried upgrading to 8.0.2, but I consistently get an Uncaught TypeError: Cannot read property 'isDescriptor' of undefined error when trying to render a {{step-manager}} component. The full stack trace is at the bottom of the issue.

I'm not positive the issue is strictly with this codebase, but part of the stack trace points to the compiled step-node.js which looks like this in my local:

define("ember-steps/-private/step-node", ["exports", "@babel/runtime/helpers/esm/decorate", "@ember-decorators/object"], function (_exports, _decorate2, _object) {
  "use strict";

  Object.defineProperty(_exports, "__esModule", {
    value: true
  });
  _exports.default = void 0;
  let StepNode = (0, _decorate2.default)(null, function (_initialize) {
    class StepNode {
      // elided
    }
  });
  _exports.default = StepNode;
});

I seem to get the same error on 7.0.0. There are other libs using typescript in my app that are working properly, leading me to believe that the issue lies with this repo.


Full stack trace:

Uncaught TypeError: Cannot read property 'isDescriptor' of undefined
    at index.js:100
    at computed.js:28
    at decorator.js:46
    at Object.decorateElement (decorate.js:118)
    at Object.<anonymous> (decorate.js:83)
    at Array.forEach (<anonymous>)
    at Object.decorateClass (decorate.js:81)
    at _decorate (decorate.js:21)
    at Module.callback (step-node.js:8)
    at Module.exports (loader.js:106)
(anonymous) @   index.js:100
(anonymous) @   computed.js:28
(anonymous) @   decorator.js:46
decorateElement @   decorate.js:118
(anonymous) @   decorate.js:83
decorateClass   @   decorate.js:81
_decorate   @   decorate.js:21
(anonymous) @   step-node.js:8 <-----
Module.exports  @   loader.js:106
Module._reify   @   loader.js:143
Module.reify    @   loader.js:130
Module.exports  @   loader.js:104
Module._reify   @   loader.js:143
Module.reify    @   loader.js:130
Module.exports  @   loader.js:104
Module._reify   @   loader.js:143
Module.reify    @   loader.js:130
Module.exports  @   loader.js:104
Module._reify   @   loader.js:143
Module.reify    @   loader.js:130
Module.exports  @   loader.js:104
requireModule   @   loader.js:27
_extractDefaultExport   @   index.js:422
resolveOther    @   index.js:103
resolve @   index.js:163
resolve @   container.js:1197
resolve @   container.js:737
resolve @   container.js:740
factoryFor  @   container.js:297
factoryFor  @   container.js:212
factoryFor  @   container_proxy.js:128
componentFor    @   component_lookup.js:9
lookupComponentPair @   lookup-component.js:40
lookupComponent @   lookup-component.js:60
_lookupComponentDefinition  @   glimmer.js:9642
lookupComponentHandle   @   glimmer.js:9416
lookupComponentDefinition   @   glimmer.js:6645
refineBlockSyntax   @   glimmer.js:9233
compile @   opcode-compiler.js:366
compileBlock    @   opcode-compiler.js:922
compileBlock    @   opcode-compiler.js:1476
(anonymous) @   opcode-compiler.js:197
compile @   opcode-compiler.js:41
compile @   opcode-compiler.js:732
add @   opcode-compiler.js:926
compile @   opcode-compiler.js:721
(anonymous) @   runtime.js:718
evaluate    @   runtime.js:70
evaluateSyscall @   runtime.js:3269
evaluateInner   @   runtime.js:3215
evaluateOuter   @   runtime.js:3207
next    @   runtime.js:5262
execute @   runtime.js:5244
handleException @   runtime.js:4101
handleException @   runtime.js:4278
throw   @   runtime.js:4025
evaluate    @   runtime.js:854
execute @   runtime.js:4008
rerender    @   runtime.js:4305
render  @   glimmer.js:5888
runInTransaction    @   metal.js:593
runInTransaction    @   metal.js:728
_renderRoots    @   glimmer.js:6179
_renderRootsTransaction @   glimmer.js:6216
_revalidate @   glimmer.js:6262
invoke  @   backburner.js:335
flush   @   backburner.js:226
flush   @   backburner.js:423
_end    @   backburner.js:957
end @   backburner.js:707
_run    @   backburner.js:1012
_join   @   backburner.js:986
join    @   backburner.js:757
join    @   index.js:165
hash.success    @   rest.js:918
fire    @   jquery.js:3291
fireWith    @   jquery.js:3421
done    @   jquery.js:9533
(anonymous) @   jquery.js:9785
load (async)        
send    @   jquery.js:9804
ajax    @   jquery.js:9434
_ajaxRequest    @   rest.js:936
_ajax   @   rest.js:962
(anonymous) @   rest.js:926
initializePromise   @   rsvp.js:532
Promise @   rsvp.js:1019
ajax    @   rest.js:915
findRecord  @   rest.js:446
(anonymous) @   -private.js:7034
tryCatcher  @   rsvp.js:335
invokeCallback  @   rsvp.js:506
(anonymous) @   rsvp.js:570
(anonymous) @   rsvp.js:16
invoke  @   backburner.js:335
flush   @   backburner.js:226
flush   @   backburner.js:423
_end    @   backburner.js:957
end @   backburner.js:707
_run    @   backburner.js:1012
_join   @   backburner.js:986
join    @   backburner.js:757
join    @   index.js:165
(anonymous) @   index.js:260
mightThrow  @   jquery.js:3557
process @   jquery.js:3625
setTimeout (async)      
(anonymous) @   jquery.js:3663
fire    @   jquery.js:3291
fireWith    @   jquery.js:3421
fire    @   jquery.js:3429
fire    @   jquery.js:3291
fireWith    @   jquery.js:3421
ready   @   jquery.js:3901
completed   @   jquery.js:3911
alexlafroscia commented 5 years ago

Could definitely be something fishy with the repo, but I've never come across this before...

Could you check out the beta release that I cut recently for 9.0.0-beta.0? I removed TypeScript entirely going forward -- that would make it easy to determine if TypeScript is actually the problem or if something else is going on.

glyoko commented 5 years ago

It seems to work fine with 9.0.0-beta.0

alexlafroscia commented 5 years ago

Great. Are you comfortable with me closing that and considering the fix to be using the beta release?

I will be cutting the official next release in the next few days.

glyoko commented 5 years ago

That works for my use case if the beta release is stable. I only upgraded to 8.0.2 because I figured 9.0.0 was still in beta and wasn't fully ready yet.

But if we don't know what causes it, it could be an issue for those currently using 8.0.2. (Though admittedly, since the bug has to do with TS compilation, I doubt anyone already successfully using 8.0 will run into it later.) Saying that the fix for the bug is to upgrade to 9.0 is kinda like saying that 8.0 is no longer maintained. That's your call though, as the maintainer.

I'm satisfied, as the 9.0.0-beta.0 release works for me.

alexlafroscia commented 5 years ago

As far as I'm concerned, once 9.0.0 is out the previous release is no longer supported. I'm going to say removing TypeScript was the fix here!

Thanks for the feedback and bug report!