Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Referencing current_component from svelte/internal has broken the Input component when used with Nollup #65

Open
matt-psaltis opened this issue Aug 8, 2020 · 0 comments

Comments

@matt-psaltis
Copy link

matt-psaltis commented Aug 8, 2020

This change was introduced in a recent commit. See: 206322d
As a result, the current_component import has a value of undefined when passed into the getEventsAction function.

To reproduce, use the Nollup template and add an Input tag to the App.
The below stack trace occurs.

TypeError: Cannot read property '$$' of undefined
    at eval (node_modules/svelma/src/utils/index.js:44:42)
    at Object.mount [as m] (eval at <anonymous> (https://localhost/build/bundle.js:40958:17), <anonymous>:161:58)
    at mount (eval at <anonymous> (https://localhost/build/bundle.js:40958:17), <anonymous>:410:14)
    at Object.targetCmp.$$.fragment.m (node_modules/svelte-hmr/runtime/svelte-hooks.js:189:24)
    at mount_component (node_modules/svelte/internal/index.mjs:1376:26)
    at Object.mount [as m] (eval at <anonymous> (https://localhost/build/bundle.js:460:17), <anonymous>:64:4)
    at mount_component (node_modules/svelte/internal/index.mjs:1376:26)
    at init (node_modules/svelte/internal/index.mjs:1465:9)
    at new App (eval at <anonymous> (https://localhost/build/bundle.js:460:17), <anonymous>:114:3)
    at createProxiedComponent (node_modules/svelte-hmr/runtime/svelte-hooks.js:237:9)

Swapping the import from: import { current_component } from 'svelte/internal'
to: import { get_current_component } from 'svelte/internal'

And the reference on line 131 becomes: const events = getEventsAction(get_current_component());

This has fixed it for my scenario.

Svelma: 0.4.0
Svelte: 3.24.1
Nollup: 0.13.2
Rollup: 2.23.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant