Vue/JS TypeError when viewing a file in a folder in a branch with the refactor_blob_viewer feature flag enabled

Summary

The file content isn't shown of a file in a folder in a non-default branch when the refactor_blob_viewer feature flag is enabled. The console shows an error:

vue.esm.js?a07f:628 [Vue warn]: Error in render: "TypeError: Cannot read property 'type' of undefined"

found in

---> <BlobContentViewer> at repository/components/blob_content_viewer.vue
       <Root>

vue.esm.js?a07f:1897 TypeError: Cannot read property 'type' of undefined
    at Proxy.render (webpack-internal:///pVGS:24)
    at VueComponent.Vue._render (webpack-internal:///jB52:3551)
    at VueComponent.updateComponent (webpack-internal:///jB52:4069)
    at Watcher.get (webpack-internal:///jB52:4482)
    at Watcher.run (webpack-internal:///jB52:4557)
    at flushSchedulerQueue (webpack-internal:///jB52:4313)
    at Array.eval (webpack-internal:///jB52:1988)
    at flushCallbacks (webpack-internal:///jB52:1914)

This fails the QA test qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb.

To reproduce

  1. Create a new project with a readme
  2. Create a new branch
  3. Add a file named test-file.md in a folder named test with the content new content. (I don't know what part of this step is essential to reproduce the bug, but it didn't happen in the main branch, nor when test-file.md is not in a folder)

The UI shows a loading icon and the console shows the error above.

vue-error

/cc @jerasmus