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

ReferenceError: div is not defined #95

Closed
amirhoseinsalimi opened this issue Mar 25, 2020 · 2 comments
Closed

ReferenceError: div is not defined #95

amirhoseinsalimi opened this issue Mar 25, 2020 · 2 comments

Comments

@amirhoseinsalimi
Copy link

Hi,

The following example from the docs:

<script>
	import Button from 'components/Button';
	import Menu from 'components/Menu';
	import List from 'components/List';

  let open = true;
	let selected = "";

  const items = [
		{ value: 1, text: 'One' },
		{ value: 2, text: 'Two' },
		{ value: 3, text: 'Three' },
		{ value: 4, text: 'Four' },
		{ value: 5, text: 'Five' },
	];

</script>

<small>Selected: {selected || 'nothing'}</small>

<Menu bind:open {items} bind:value={selected}>
	<div slot="activator">
		<Button on:click={() => open = !open}>A menu</Button>
	</div>
</Menu>

throws the error:

Uncaught (in promise) ReferenceError: div is not defined
    at Object.update [as p] (Menu.svelte:47)
    at Object.update [as p] (Menu.svelte:44)
    at update (index.mjs:687)
    at flush (index.mjs:656)

I can't find why is that happening?

@shanna
Copy link

shanna commented Mar 26, 2020

I hit the same issue. After some searching it appears to be an upstream bug in svelte 3.20.0 that 3.20.1 attempted to fix but did not.

3.19.2 is the last known working version so I've pinned my project to that till the bug is fixed.

See:
sveltejs/svelte#4597
sveltejs/svelte#4562

@amirhoseinsalimi
Copy link
Author

amirhoseinsalimi commented Mar 26, 2020

Thank ya, that worked. For now, I fixed my version to that specific version as a quick fix. So I close this issue cause it is regarding Svelte.

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

2 participants