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

How to run demo sveltekit svelte-lexical ? #91

Open
ProtonBeamCannon opened this issue Aug 17, 2024 · 13 comments
Open

How to run demo sveltekit svelte-lexical ? #91

ProtonBeamCannon opened this issue Aug 17, 2024 · 13 comments

Comments

@ProtonBeamCannon
Copy link

Hi @umaranis I want to try out svelte-lexical and try to run the demo, for sveltekit but I keep getting this error
image

Error: Failed to resolve entry for package "svelte-lexical". The package may have incorrect main/module/exports specified in its package.json.

What should I do here ? I made sure I ran npm i svelte-lexical, so what am i missing

@umaranis
Copy link
Owner

Hi @ProtonBeamCannon ,
Have you build the ‘svelte-lexical’ package before running the demo project?

Please have a look at ‘getting started’ section in the ReadMe file. Do let me know if you still face any issues? Thanks.

@ProtonBeamCannon
Copy link
Author

ProtonBeamCannon commented Aug 18, 2024

I tried it again, i followed the readme.md and i run the demo playground and demo sveltekit and still got the same error.
the only difference i did was using npm instead pnpm, buts thats irrelevant right ?

@umaranis
Copy link
Owner

umaranis commented Aug 19, 2024

Hi @ProtonBeamCannon ,
I have just tried on a fresh clone. The build process is broken with npm but works fine with ‘pnpm`. It has also happened a few times in the past due to the ESM and CommonJS mess.

I will look into the recent package upgrades to find the culprit.

umaranis added a commit that referenced this issue Aug 19, 2024
@umaranis
Copy link
Owner

Hi @ProtonBeamCannon ,
I have pushed a fix on npm-build branch.

Could you confirm if it resolves the issue?

@ProtonBeamCannon
Copy link
Author

Did it resolve for you ?
I created a fresh clone, pick hte npm-build branch, go to the cd packages/svelte-lexical, npm i, npm run build,
I tried to go to the demos playground and sveltekit and npm run dev. but still get the same error, after that i tried run npm install and its the same,
I tried to npm run build on demos/sveltekit and i got this
image

Maybe this is a clue?
My node v20.6.1 if this matters, also this is the package.json
image

@umaranis
Copy link
Owner

Hi @ProtonBeamCannon ,
yes, 'npm-build` branch resolves the issue for me.

My node version is 22.5.1.

Are you able to upgrade to this version and test?

@umaranis
Copy link
Owner

umaranis commented Aug 21, 2024

Here is my output for the same command
image

I would appreciate it if you could upgrade your node to 22.5.1 and give it a go.

@ProtonBeamCannon
Copy link
Author

Hi, sorry responding so late, i upgrade the node to v22.5.1
image

I tried both npm and pnpm in the folder svelte-lexical and svelte-lexical/demo/sveltekit , it didnt work

image

@umaranis
Copy link
Owner

umaranis commented Sep 5, 2024

This is strange.

Could you share the full output of all the commands you are running? For instance, pnpm i, pnnpm build and pnpm dev from the packages/svelte-lexical directory. @ProtonBeamCannon

@ProtonBeamCannon
Copy link
Author

image

image

error during build: [commonjs--resolver] Failed to resolve entry for package "svelte-lexical". The package may have incorrect main/module/exports specified in its package.json. at packageEntryFailure (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47164:15) at resolvePackageEntry (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:47161:3) at tryNodeResolve (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:46977:16) at Object.resolveId (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:46727:19) at Object.handler (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:65948:15) at file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19778:40 at async PluginDriver.hookFirstAndGetPlugin (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:19678:28) at async resolveId (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18359:26) at async ModuleLoader.resolveId (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]/node_modules/rollup/dist/es/shared/node-entry.js:18762:15) at async Object.resolveId (file:///C:/Users/user/Desktop/Prog/Lexical/svelte-lexical/node_modules/.pnpm/[email protected]_@[email protected]/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:12701:10)  ELIFECYCLE  Command failed with exit code 1.

@umaranis
Copy link
Owner

umaranis commented Sep 7, 2024

Hi @ProtonBeamCannon ,

As I requested, could you please run these commands from the packages/svelte-lexical folder (not demos/sveltekit)?

@ProtonBeamCannon
Copy link
Author

Hi sorry for the late reply, yes what i meant was i tried everything but of course i tried to follow your instruction that i go to packages/svelte-lexical and then npm install then npm run build after that i got this error
image

after that i went to demos/playground and stated in your readme.md and try npm run dev but the i got the error.

Can you show me an example of it working in Stackblitz so that we can debug this in the same environment together?

@umaranis
Copy link
Owner

umaranis commented Sep 25, 2024

Hi @ProtonBeamCannon ,

Here is the StackBlitz for demos/playground:

https://stackblitz.com/~/github.com/umaranis/svelte-lexical/tree/stackblitz-playground?view=editor

Have a look at .stackblitzrc file for the start command (the branch is stackblitz-playground).

StackBlitz for packages/svelte-lexical

https://stackblitz.com/~/github.com/umaranis/svelte-lexical?configPath=packages/svelte-lexical

This is not a separate demo project, but an example included in the library project.

Stackblitz demo using npm

https://stackblitz.com/~/github.com/umaranis/svelte-lexical-playground-stackblitz?view=editor

This a separate project (outside of the monorepo using npm instead of pnpm.

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