Skip to content

CurrentInstance / currentRenderingInstance is null because of multiple chunks (lost context) #1173

@sionzee

Description

@sionzee

Version

3.0.0-beta.12

Reproduction link

https://github.com/sionzeecz/vue-next-multiple-chunks-issue

Steps to reproduce

  1. Clone the repository
  2. Run npm install
  3. Run npm run build
  4. Open public/index.html in your browser
    Check console for xx warnings xx errors

What is expected?

It should render the component without any issues

What is actually happening?

Because of being bundled in multiple chunks the activeInstance is not accessible outside of webpack a. bundle, so when the component is loaded in webpack b. bundle then the activeInstance is again null. Happens already on vue-directive Transition.

Console output:

[Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

[Vue warn]: onBeforeUnmount is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.

[Vue warn]: Unhandled error during execution of render function 
  at <BaseTransition appear=false persisted=false onBeforeEnter=fn<onBeforeEnter>  ... > 
  at <Transition> 
  at <Comp>

TypeError: Cannot read property 'subTree' of null

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions