jaumard / trailpack-annotations

:package: Add annotation support for Tails.js applications
MIT License
7 stars 4 forks source link

Error when using it in combination with trailpack-autoreload #73

Open weyert opened 7 years ago

weyert commented 7 years ago

If I am editing any file in my project when I am using trailpack-autoreload in combination with trailpack-annoations. I am receiving the error as listed below. I have attached a small project which causes the problem on my computer.

Steps:

  1. yarn install
  2. yarn start
  3. Update any file for example the api/utils/enums.js file
info: File api/utils/enums.js changed. Reloading.
info: Shutting down...
error: 
 TypeError: Cannot assign to read only property 'v' of object '#<Object>'
    at AttributeParser.<anonymous> (/Users/user/Development/Projects/messenger/backend/node_modules/ecmas-annotations/lib/attribute-parser.js:162:21)
    at Array.forEach (native)
    at AttributeParser.parse (/Users/user/Development/Projects/messenger/backend/node_modules/ecmas-annotations/lib/attribute-parser.js:123:11)
    at Reader.parseAnnotations (/Users/user/Development/Projects/messenger/backend/node_modules/ecmas-annotations/lib/reader.js:253:45)
    at Reader.parseMethodAnnotations (/Users/user/Development/Projects/messenger/backend/node_modules/ecmas-annotations/lib/reader.js:124:17)
    at Reader.<anonymous> (/Users/user/Development/Projects/messenger/backend/node_modules/ecmas-annotations/lib/reader.js:74:39)
    at Array.forEach (native)
    at Reader.parse (/Users/user/Development/Projects/messenger/backend/node_modules/ecmas-annotations/lib/reader.js:73:15)
    at iterate (/Users/user/Development/Projects/messenger/backend/node_modules/trailpack-annotations/lib/configure.js:40:12)
    at Array.forEach (native)
    at module.exports (/Users/user/Development/Projects/messenger/backend/node_modules/trailpack-annotations/lib/configure.js:55:9)
    at AnnotationsTrailpack.configure (/Users/user/Development/Projects/messenger/backend/node_modules/trailpack-annotations/index.js:17:5)
    at app.after.then.then (/Users/user/Development/Projects/messenger/backend/node_modules/trails/lib/trailpack.js:48:26)
    at process._tickDomainCallback (internal/process/next_tick.js:129:7)
info: Shutting down...
(node:19300) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'close' of undefined

bug.zip