sveltestrap icon indicating copy to clipboard operation
sveltestrap copied to clipboard

Fixs for svelte4

Open splimter opened this issue 2 years ago • 17 comments

  • Fixing Modal
  • Fixing the .d.ts files

splimter avatar Oct 09 '23 09:10 splimter

When I do npm install 'git+https://github.com/bestguy/sveltestrap.git#pull/574/head' to install from this pull request, I'm getting the following error:

npm ERR! Found: [email protected]
npm ERR! node_modules/svelte
npm ERR!   dev svelte@"^4.0.5" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer svelte@"^3.53.1" from [email protected]
npm ERR! node_modules/sveltestrap
npm ERR!   sveltestrap@"git+https://github.com/bestguy/sveltestrap.git#pull/574/head" from the root project

Looks like this PR needs a package.json update to change the svelte dependency to 4.x?

LoopControl avatar Oct 11 '23 01:10 LoopControl

Still getting error after the 3 commits above. When I --force the install it works with this error:

npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/svelte
npm WARN   peer svelte@"^3.54.0 || ^4.0.0-next.0" from @sveltejs/[email protected]
npm WARN   node_modules/@sveltejs/kit
npm WARN     peer @sveltejs/kit@"^1.0.0" from @sveltejs/[email protected]
npm WARN     node_modules/@sveltejs/adapter-auto
npm WARN     1 more (the root project)
npm WARN   9 more (@sveltejs/vite-plugin-svelte, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer svelte@"^3.53.1" from [email protected]
npm WARN node_modules/sveltestrap
npm WARN   sveltestrap@"git+https://github.com/bestguy/sveltestrap.git#pull/574/head" from the root project
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/svelte
npm WARN   peer svelte@"^3.53.1" from [email protected]
npm WARN   node_modules/sveltestrap
npm WARN     sveltestrap@"git+https://github.com/bestguy/sveltestrap.git#pull/574/head" from the root project

LoopControl avatar Oct 11 '23 23:10 LoopControl

Hi @LoopControl thank you for checking our work. Please try with --legacy-peer-deps, it did the trick for me.

splimter avatar Oct 12 '23 08:10 splimter

Hello @LoopControl please disregard my last message, and try again.

splimter avatar Oct 12 '23 11:10 splimter

Thanks for this!!

benmccann avatar Oct 12 '23 13:10 benmccann

@splimter I think the peer dependency version also needs to be updated in package.json?

Right now only v3 is added:

  "peerDependencies": {
    "svelte": "^3.53.1"
  },

Most likely it needs to be updated the same as the dev dependency?

"svelte": "^3.53.1 || ^4.2.1"

milansimek avatar Oct 12 '23 17:10 milansimek

@splimter Created pull request: https://github.com/edraj/sveltestrap/pull/1

Can confirm installing without --legacy-peer-deps works after this change

milansimek avatar Oct 12 '23 18:10 milansimek

Thank you @milansimek !

@splimter I have merged the pull request against our main PR.

Kindly let me know if there is any known issues left on this front. (e..g upgrading any other dependencies)

kefahi avatar Oct 13 '23 12:10 kefahi

Hmm. It looks like this project doesn't run the CI against PRs. Can you update the file in the .github directory to include the following?

on:
  push:
    branches:
      - master
  pull_request:

I suspect this PR will need some changes to avoid breaking the tests, but I can't tell if they're passing or not until we run them

benmccann avatar Oct 13 '23 13:10 benmccann

Hello @benmccann Thank you for your input. I made a number of changes and upgrades to make it work. The CI now runs successfully.

kefahi avatar Oct 14 '23 05:10 kefahi

Thanks for the work on this PR! For me the modal isn't working yet, it shows up (better then the main branch). But it has no close icon and does not close when clicking next to the Modal.

image

Just my first Svelte project so I have no clue how to debug this further. I just copied the example Modal from the docs :)

wilmardo avatar Oct 26 '23 17:10 wilmardo

hi @wilmardo thanks for the feedback, please make sure that the toggle prop is on both Modal and ModalHeader, lemme know if that did solve your issue.

splimter avatar Oct 29 '23 10:10 splimter

Can confirm this works on my current project.

georgeemr avatar Nov 02 '23 06:11 georgeemr

I've tested this PR from our Sveltekit (Svelte4) project and there is no issue related to both modal and offcanvas. Have to test more for completely migrate, but still looks good to me.

SoyaNyan avatar Nov 11 '23 14:11 SoyaNyan

Hi, how long this PR will be merged? The modal is currently not working. I cannot use sveltestrap with Svelte 4 on cloud CI/CD. I only fixed it in local env but in the cloud it always gets the not-working version.

vdp641 avatar Nov 21 '23 16:11 vdp641

Hello @vdp641 , what is the issue that you are facing with the modal.

splimter avatar Nov 21 '23 16:11 splimter

@splimter hi, in the current version of sveltestrap, with Svelte 4, that does not fix the issue with global transition in Modal.svelte. It leads to Modal not opened. This PR will fix this issue, but it has not been merged yet.

vdp641 avatar Nov 21 '23 17:11 vdp641