question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot destructure property 'addNotification' of 'getNotificationsContext(...)' as it is undefined.

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
silverdrcommented, Nov 29, 2021

Are there any examples of simple, single-component usage of svelte-notifications?

0reactions
usernamuscommented, Jan 25, 2022

@TylerRick, context doesn’t matter here. I’m now thinking of getting rid of it in favor of using just a store

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found