收藏
回答

升级至最新版1.02.1905081编译预览经常不过,是bug吗?

框架类型 问题类型 操作系统 工具版本
小程序 Bug macOS 1.02.1905081

- 当前 Bug 的表现(可附上截图)

自动预览







多次错误编译后,居然通过了。

自动上传也是如此,自动上传需要clear所有文件后,重新生成,所以一直没过,是否编译时有缓存,并发之类的,导制通过不了?


IDE server has started, listening on http://127.0.0.1:50551

initialization finished

uploading project...

{ i [StatusCodeError]: 400 - "{\"code\":40000,\"error\":\"错误 Error: file: lib/storage/word-storage.js\\n unknown: Cannot read property 'contexts' of null\\n \"}"

    at new i (/Applications/wechatwebdevtools.app/Contents/Resources/package.nw/js/common/cli/index.js:157:46301)

    at H.callback (/Applications/wechatwebdevtools.app/Contents/Resources/package.nw/js/common/cli/index.js:157:45150)

    at H.e.callback.a.callback [as _callback] (/Applications/wechatwebdevtools.app/Contents/Resources/package.nw/js/common/cli/index.js:157:44204)

    at H.a._callback.a.callback.a.callback (/Applications/wechatwebdevtools.app/Contents/Resources/package.nw/js/common/cli/index.js:187:5473)

    at H.emit (events.js:193:13)

    at H.<anonymous> (/Applications/wechatwebdevtools.app/Contents/Resources/package.nw/js/common/cli/index.js:187:18286)

    at H.emit (events.js:193:13)

    at IncomingMessage.<anonymous> (/Applications/wechatwebdevtools.app/Contents/Resources/package.nw/js/common/cli/index.js:187:17128)

    at Object.onceWrapper (events.js:281:20)

    at IncomingMessage.emit (events.js:198:15)

  name: 'StatusCodeError',

  statusCode: 400,

  message:

   `400 - "{\\"code\\":40000,\\"error\\":\\"错误 Error: file: lib/storage/word-storage.js\\\\n unknown: Cannot read property 'contexts' of null\\\\n \\"}"`,

  error:

   `{"code":40000,"error":"错误 Error: file: lib/storage/word-storage.js\\n unknown: Cannot read property 'contexts' of null\\n "}`,

  options:

   { url:

      'http://127.0.0.1:50551/upload?cli=1&projectpath=%252FUsers%252Fabc%252FPycharmProjects%252Fstudy-app%252Fstudy-project%252Fmini-app%252Fversions%252F..%252Fmini-program%252Fwx7b4db1bd999d314f&version=1.0.544&desc=upload%253A&infooutput=',

     resolveWithFullResponse: true,

     callback: [Function],

     transform: undefined,

     simple: true,

     transform2xxOnly: false },

  response:

   IncomingMessage {

     _readableState:

      ReadableState {

        objectMode: false,

        highWaterMark: 16384,

        buffer: BufferList { head: null, tail: null, length: 0 },

        length: 0,

        pipes: null,

        pipesCount: 0,

        flowing: true,

        ended: true,

        endEmitted: true,

        reading: false,

        sync: true,

        needReadable: false,

        emittedReadable: false,

        readableListening: false,

        resumeScheduled: false,

        paused: false,

        emitClose: true,

        autoDestroy: false,

        destroyed: false,

        defaultEncoding: 'utf8',

        awaitDrain: 0,

        readingMore: true,

        decoder: null,

        encoding: null },

     readable: false,

     _events:

      [Object: null prototype] {

        end: [Array],

        close: [Array],

        data: [Function],

        error: [Function] },

     _eventsCount: 4,

     _maxListeners: undefined,

     socket:

      Socket {

        connecting: false,

        _hadError: false,

        _parent: null,

        _host: null,

        _readableState: [ReadableState],

        readable: true,

        _events: [Object],

        _eventsCount: 7,

        _maxListeners: undefined,

        _writableState: [WritableState],

        writable: false,

        allowHalfOpen: false,

        _sockname: null,

        _pendingData: null,

        _pendingEncoding: '',

        server: null,

        _server: null,

        parser: null,

        _httpMessage: [ClientRequest],

        [Symbol(asyncId)]: 36,

        [Symbol(kHandle)]: [TCP],

        [Symbol(lastWriteQueueSize)]: 0,

        [Symbol(timeout)]: null,

        [Symbol(kBytesRead)]: 0,

        [Symbol(kBytesWritten)]: 0 },

     connection:

      Socket {

        connecting: false,

        _hadError: false,

        _parent: null,

        _host: null,

        _readableState: [ReadableState],

        readable: true,

        _events: [Object],

        _eventsCount: 7,

        _maxListeners: undefined,

        _writableState: [WritableState],

        writable: false,

        allowHalfOpen: false,

        _sockname: null,

        _pendingData: null,

        _pendingEncoding: '',

        server: null,

        _server: null,

        parser: null,

        _httpMessage: [ClientRequest],

        [Symbol(asyncId)]: 36,

        [Symbol(kHandle)]: [TCP],

        [Symbol(lastWriteQueueSize)]: 0,

        [Symbol(timeout)]: null,

        [Symbol(kBytesRead)]: 0,

        [Symbol(kBytesWritten)]: 0 },

     httpVersionMajor: 1,

     httpVersionMinor: 1,

     httpVersion: '1.1',

     complete: true,

     headers:

      { 'content-type': 'application/json;  charset=utf-8',

        date: 'Thu, 09 May 2019 02:21:01 GMT',

        connection: 'close',

        'transfer-encoding': 'chunked' },

     rawHeaders:

      [ 'Content-Type',

        'application/json;  charset=utf-8',

        'Date',

        'Thu, 09 May 2019 02:21:01 GMT',

        'Connection',

        'close',

        'Transfer-Encoding',

        'chunked' ],

     trailers: {},

     rawTrailers: [],

     aborted: false,

     upgrade: false,

     url: '',

     method: null,

     statusCode: 400,

     statusMessage: 'Bad Request',

     client:

      Socket {

        connecting: false,

        _hadError: false,

        _parent: null,

        _host: null,

        _readableState: [ReadableState],

        readable: true,

        _events: [Object],

        _eventsCount: 7,

        _maxListeners: undefined,

        _writableState: [WritableState],

        writable: false,

        allowHalfOpen: false,

        _sockname: null,

        _pendingData: null,

        _pendingEncoding: '',

        server: null,

        _server: null,

        parser: null,

        _httpMessage: [ClientRequest],

        [Symbol(asyncId)]: 36,

        [Symbol(kHandle)]: [TCP],

        [Symbol(lastWriteQueueSize)]: 0,

        [Symbol(timeout)]: null,

        [Symbol(kBytesRead)]: 0,

        [Symbol(kBytesWritten)]: 0 },

     _consuming: false,

     _dumped: false,

     req:

      ClientRequest {

        _events: [Object],

        _eventsCount: 5,

        _maxListeners: undefined,

        outputData: [],

        outputSize: 0,

        writable: true,

        _last: true,

        chunkedEncoding: false,

        shouldKeepAlive: false,

        useChunkedEncodingByDefault: false,

        sendDate: false,

        _removedConnection: false,

        _removedContLen: false,

        _removedTE: false,

        _contentLength: 0,

        _hasBody: true,

        _trailer: '',

        finished: true,

        _headerSent: true,

        socket: [Socket],

        connection: [Socket],

        _header:

         'GET /upload?cli=1&projectpath=%252FUsers%252Fabc%252FPycharmProjects%252Fstudy-app%252Fstudy-project%252Fmini-app%252Fversions%252F..%252Fmini-program%252Fwx7b4db1bd999d314f&version=1.0.544&desc=upload%253A&infooutput= HTTP/1.1\r\nhost: 127.0.0.1:50551\r\nConnection: close\r\n\r\n',

        _onPendingData: [Function: noopPendingOutput],

        agent: [Agent],

        socketPath: undefined,

        timeout: undefined,

        method: 'GET',

        path:

         '/upload?cli=1&projectpath=%252FUsers%252Fabc%252FPycharmProjects%252Fstudy-app%252Fstudy-project%252Fmini-app%252Fversions%252F..%252Fmini-program%252Fwx7b4db1bd999d314f&version=1.0.544&desc=upload%253A&infooutput=',

        _ended: true,

        res: [Circular],

        aborted: false,

        timeoutCb: null,

        upgradeOrConnect: false,

        parser: null,

        maxHeadersCount: null,

        [Symbol(isCorked)]: false,

        [Symbol(outHeadersKey)]: [Object] },

     request:

      H {

        _events: [Object],

        _eventsCount: 5,

        _maxListeners: undefined,

        resolveWithFullResponse: true,

        readable: true,

        writable: true,

        _qs: [r],

        _auth: [c],

        _oauth: [u],

        _multipart: [s],

        _redirect: [r],

        _tunnel: [s],

        _rp_resolve: [Function],

        _rp_reject: [Function],

        _rp_promise: [Promise],

        _rp_callbackOrig: undefined,

        callback: [Function],

        _rp_options: [Object],

        headers: {},

        setHeader: [Function],

        hasHeader: [Function],

        getHeader: [Function],

        removeHeader: [Function],

        method: 'GET',

        localAddress: undefined,

        pool: {},

        dests: [],

        __isRequestRequest: true,

        _callback: [Function],

        uri: [Url],

        proxy: null,

        tunnel: false,

        setHost: true,

        originalCookieHeader: undefined,

        _disableCookies: true,

        _jar: undefined,

        port: '50551',

        host: '127.0.0.1',

        path:

         '/upload?cli=1&projectpath=%252FUsers%252Fabc%252FPycharmProjects%252Fstudy-app%252Fstudy-project%252Fmini-app%252Fversions%252F..%252Fmini-program%252Fwx7b4db1bd999d314f&version=1.0.544&desc=upload%253A&infooutput=',

        httpModule: [Object],

        agentClass: [Function],

        agent: [Agent],

        _started: true,

        href:

         'http://127.0.0.1:50551/upload?cli=1&projectpath=%252FUsers%252Fabc%252FPycharmProjects%252Fstudy-app%252Fstudy-project%252Fmini-app%252Fversions%252F..%252Fmini-program%252Fwx7b4db1bd999d314f&version=1.0.544&desc=upload%253A&infooutput=',

        req: [ClientRequest],

        ntick: true,

        response: [Circular],

        originalHost: '127.0.0.1:50551',

        originalHostHeaderName: 'host',

        responseContent: [Circular],

        _destdata: true,

        _ended: true,

        _callbackCalled: true },

     toJSON: [Function: L],

     caseless: t { dict: [Object] },

     body:

      `{"code":40000,"error":"错误 Error: file: lib/storage/word-storage.js\\n unknown: Cannot read property 'contexts' of null\\n "}` } }


- 预期表现

一次性编译预览通过,但总是不通过,然后多进行几次又莫名通过,在IDE中直接点击预览、上传均出现同样问题。

- 复现路径


- 提供一个最简复现 Demo


回答关注问题邀请回答
收藏

1 个回答

  • 继勇
    继勇
    2019-05-09

    对了,经常出现 的 Cannot read property 'contexts' of null ,在源代码的文件里并没有 contexts,这个contexts是否是编码过程产生的?

    2019-05-09
    赞同
    回复 2
    • 继勇
      继勇
      2019-05-09

      是一直存在的一个本地项目(未发布,仅体验),已经退回 1.02.1904090 版本了 ,可以正常通过。


      2019-05-09
      回复
    • 燚
      2019-05-10回复继勇

      有开启什么编译选项吗?es6转es5?增强编译?代码压缩?

      2019-05-10
      回复
登录 后发表内容