repro_getContext_from_comp_inside_each Svelte Themes

Repro_getcontext_from_comp_inside_each

Reproduce Svelte error "Function called outside component initialization" when getContext from a _component_ (which should be allowed) inside an each loop

This is a minimal reproduction of a "Function called outside component initialization" error that I ran into in a real app, and my various attempts to figure out the cause and resolution of the error.

More information can be found in this question: https://stackoverflow.com/questions/64152594/should-svelte-libraries-include-external-svelte-in-rollup-config-js-func

To build this app:

  1. npm i

  2. Build its dependency:

    cd packages/my-new-component/
    npx rollup -c -w
    
  3. Build the app:

    npx rollup -c -w
    

Top categories

Loading Svelte Themes