You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
aspect.js is broken when using Node.js in a plain JavaScript project that uses Babel 7; error is below. Babel settings are in the babel section of the package.json. I have a feeling that the issue is related to @babel/plugin-proposal-decorators.
/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/aspect.js/src/join_points/static_method.js:61
pointcut.advice = new constr(target, descriptor.value);
^
TypeError: Cannot read property 'value' of undefined
at /Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/aspect.js/src/join_points/static_method.js:61:61
at _decorateElement (/Users/matthewadams/dev/aspect.js-babel7-poc/lib/main/aspects/Aspect.js:1:45845)
at /Users/matthewadams/dev/aspect.js-babel7-poc/lib/main/aspects/Aspect.js:1:44152
at Array.forEach (<anonymous>)
at _decorateClass (/Users/matthewadams/dev/aspect.js-babel7-poc/lib/main/aspects/Aspect.js:1:43891)
at _decorate (/Users/matthewadams/dev/aspect.js-babel7-poc/lib/main/aspects/Aspect.js:1:37108)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/lib/main/aspects/Aspect.js:2:112)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module.replacementCompile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:58:13)
at Module._compile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at /Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4
at newLoader (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/pirates/lib/index.js:88:7)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/lib/main/Thing.js:1:56820)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module.replacementCompile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:58:13)
at Module._compile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at /Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4
at newLoader (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/pirates/lib/index.js:88:7)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/lib/test/integration/Thing.spec.js:9:15)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module.replacementCompile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:58:13)
at Module._compile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/pirates/lib/index.js:83:24)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at /Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4
at newLoader (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/pirates/lib/index.js:88:7)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Module.require (internal/modules/cjs/loader.js:636:17)
at require (internal/modules/cjs/helpers.js:20:18)
at /Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/mocha/lib/mocha.js:250:27
at Array.forEach (<anonymous>)
at Mocha.loadFiles (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/mocha/lib/mocha.js:247:14)
at Mocha.run (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/mocha/lib/mocha.js:576:10)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/mocha/bin/_mocha:637:18)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Module.replacementCompile (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:58:13)
at Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/node_modules/append-transform/index.js:62:4)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at runMain (/Users/matthewadams/.node-spawn-wrap-38692-42f74de48f81/node:68:10)
at Function.<anonymous> (/Users/matthewadams/.node-spawn-wrap-38692-42f74de48f81/node:171:5)
at Object.<anonymous> (/Users/matthewadams/dev/aspect.js-babel7-poc/node_modules/nyc/bin/wrap.js:23:4)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at /Users/matthewadams/.node-spawn-wrap-38692-42f74de48f81/node:178:8
at Object.<anonymous> (/Users/matthewadams/.node-spawn-wrap-38692-42f74de48f81/node:181:3)
at Module._compile (internal/modules/cjs/loader.js:688:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
at Module.load (internal/modules/cjs/loader.js:598:32)
at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
at Function.Module._load (internal/modules/cjs/loader.js:529:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
at startup (internal/bootstrap/node.js:285:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
The text was updated successfully, but these errors were encountered:
matthewadams
changed the title
"Cannot read property 'value' of undefined" when using from Node.js 10.12.0, plain JavaScript project that uses Babel 7
Getting "Cannot read property 'value' of undefined" when using from Node.js 10.12.0, plain JavaScript project that uses Babel 7
Nov 11, 2018
matthewadams
changed the title
Getting "Cannot read property 'value' of undefined" when using from Node.js 10.12.0, plain JavaScript project that uses Babel 7
Getting "Cannot read property 'value' of undefined" when using aspect.js from Node.js 10.12.0, plain JavaScript project that uses Babel 7
Nov 11, 2018
Running npm t fixed the tests, but I also had to change one other thing: the this reference in MethodCallCounterAspect looks like it's not getting set correctly, so I can't use state in my aspects. I'll open a separate issue for that.
I'll close this issue and open another one to support the modern behavior of @babel/plugin-proposal-decorators.
aspect.js is broken when using Node.js in a plain JavaScript project that uses Babel 7; error is below. Babel settings are in the
babel
section of thepackage.json
. I have a feeling that the issue is related to@babel/plugin-proposal-decorators
.A git repository with reproducible test case is at https://github.com/matthewadams/aspect.js-babel7-poc. You can reproduce the error by cloning the repo and issuing the following command:
The same error exists when using Node.js 8.12.0.
I'm getting the following error:
The text was updated successfully, but these errors were encountered: