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

Failed NPM Install - exports problem? #5

Open
cycle4passion opened this issue Feb 26, 2022 · 4 comments
Open

Failed NPM Install - exports problem? #5

cycle4passion opened this issue Feb 26, 2022 · 4 comments

Comments

@cycle4passion
Copy link

I understand it's alpha, and in flux, just a FYI

Environment: Svelte+TS

version 0.1.14 works in REPL
fails in VSCode
fails in Stackblitz

Stackblitz steps:

Start new Svelte + TS project
npm i @leveluptuts/svelte-toy
paste in demo to App.svelte

<script>
	import Toy from '@leveluptuts/svelte-toy';
	import { writable } from 'svelte/store';

	let example = writable({
		name: 'John',
		isActive: false
	});
</script>

<h1>Hi, my name is {$example.name}</h1>

{#if $example.isActive}
	<p>I'm active</p>
{/if}

<Toy register={[{ example }]} />

Error: [plugin:vite:import-analysis] Failed to resolve entry for package "@leveluptuts/svelte-toy". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@leveluptuts/svelte-toy". The package may have incorrect main/module/exports specified in its package.json.

@maku
Copy link

maku commented Jun 29, 2022

Yeah I have the same problem. Here is my simple repl https://svelte.dev/repl/4c36a8e491c24d11b44a4b09a65a3795?version=3.48.0

@stolinski do I something wrong?

@stolinski
Copy link
Contributor

Just pushed v2. import { Toy } from '@leveluptuts/svelte-toy' is now the correct import

@cycle4passion
Copy link
Author

Now errors with 'store' is not a store with a 'subscribe' method" in Svelte REPL. In Stackblitz the error is "Failed to resolve entry for package "@leveluptuts/svelte-toy". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@leveluptuts/svelte-toy". The package may have incorrect main/module/exports specified in its package.json."

@stolinski
Copy link
Contributor

The repl may have changed. I updated the readme to have the new error https://svelte.dev/repl/4566ac90a5ca42d6ade1c383b6f1ba66?version=3.43.1

The api has changed slightly so the store error is because of that that change. The main prop is now ={{storeName, storeName2}} rather than ={[{storeName}, {storeName2}]}. Double check you are using v2.0.0

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

3 participants