Question And Answer

问答系列

  1. ### Chrome in iOS, history.pushState will casue bottom toolbar to disappear.

    https://github.com/powerfulyang/powerfulyang.com/issues/23
    So don't use history.pushState.

  2. ### How to disable overflow-x scroolbar in monaco-editor?

    https://github.com/powerfulyang/powerfulyang.com/issues/28
    options => wordWrap: 'on'

  3. ### Safari don't send browser cookies during a 302 redirect

    https://github.com/powerfulyang/api.powerfulyang.com/issues/46 https://developer.apple.com/forums/thread/113892
    Safari executes redirect before reading all headers, set-cookie did after redirect. In iOS 15.3.1, set-cookie did behind redirect.

  4. ### Nest.js, Error: Can't set headers after they are sent to the client

    https://github.com/powerfulyang/api.powerfulyang.com/issues/50 https://powerfulyang.com/post/40

  5. ### Click to edit should ensure it exist.
    Before go to edit page, ensure item exist to prevent crash.

  6. ### OpenWrt can't resovle domain DNS to Local Area Network,LAN.
    Uncheck Network => DCHP and DNS => General Settings => Rebind protection

  7. ### NestJS Request Lifecycle.

    https://docs.nestjs.com/faq/request-lifecycle

    In general, the request lifecycle looks like the following:

    1. Incoming request
    2. Globally bound middleware
    3. Module bound middleware
    4. Global guards
    5. Controller guards
    6. Route guards
    7. Global interceptors (pre-controller)
    8. Controller interceptors (pre-controller)
    9. Route interceptors (pre-controller)
    10. Global pipes
    11. Controller pipes
    12. Route pipes
    13. Route parameter pipes
    14. Controller (method handler)
    15. Service (if exists)
    16. Route interceptor (post-request)
    17. Controller interceptor (post-request)
    18. Global interceptor (post-request)
    19. Exception filters (route, then controller, then global)
    20. Server response
  8. ### Why have typescript property decorators stopped working after an upgrade?

    https://stackoverflow.com/questions/68941453/why-have-typescript-property-decorators-stopped-working-after-an-upgrade

    The fix for TypeScript property decorators breaking when you upgrade TypeScript is to add "useDefineForClassFields": false to your tsconfig.json.