Cannot destructure property 'addNotification' of 'getNotificationsContext(...)' as it is undefined.
See original GitHub issueI’m getting this error while accessing addNotification property.
Cannot destructure property 'addNotification' of 'getNotificationsContext(...)' as it is undefined.
To Reproduce
All I did is installed the package using npm i --save svelte-notifications
Then tried importing it from my _layout.svelte
import { getNotificationsContext } from 'svelte-notifications';
const { addNotification } = getNotificationsContext();
I tried printing the the value returned by getNotificationsContext()
, and it was undefined
.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Hypothesis annotation
Cannot destructure property 'addNotification' of 'getNotificationsContext(...)' as it is undefined. · Issue #40 · keenethics/svelte-notifications.
Read more >Developers - Error importing lib - - Bountysource
Uncaught (in promise) TypeError: Cannot destructure property 'addNotification' of 'getNotificationsContext(...)' as it is undefined. What i suppose to do?
Read more >The svelte-notifications from keenethics - GithubHelp
Cannot destructure property 'addNotification' of 'getNotificationsContext(...)' as it is undefined. I'm getting this error while accessing addNotification ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Are there any examples of simple, single-component usage of
svelte-notifications
?@TylerRick, context doesn’t matter here. I’m now thinking of getting rid of it in favor of using just a store