MorevM / vue-transitions

Interface transitions library for Vue 2/3
https://morevm.github.io/vue-transitions/
MIT License
190 stars 4 forks source link

Failed to resolve import @morev/vue-transitions/styles using Nuxt 3 #254

Closed r0lodex closed 7 months ago

r0lodex commented 9 months ago

Actual behavior

When building, throws error

Failed to resolve import "@morev/vue-transitions/styles" from "virtual:nuxt:/app/.nuxt/css.mjs". Does the file exist?

Expected behavior

Should've resolved the import

Steps to reproduce

// nuxt.config.ts
modules: [
    ...
    "@morev/vue-transitions/nuxt",
  ],
<TransitionSlide :offset="[-16, 0]">
    content
</TransitionSlide>

Environment

Additional context

No response

Possible solution

Possibly updating the package to have the styles imported properly.

MorevM commented 9 months ago

Good day @r0lodex,

What version of Nuxt are you using? Currently the module works fine (well, there are still some issues like types resolution and couple of bugs..) in my environment (Windows, any Nuxt@^2.x.x and Nuxt@3.6.4), maybe something went wrong because of using Bun or with Nuxt upgrade to version more than 3.6.4 - they have some Windows issues so I can't upgrade right now to test.

I'll try to take a look with Bun. Anyway, please provide more info about your environment - it might help.

For now, I believe it is possible to use the package as a custom Nuxt plugin and import stylesheet directly, I wrote about it here.

r0lodex commented 9 months ago

Thank you for responding. I'm using Nuxt 3.8.1 on MacOS Sonoma 14.2 I'll try on my end with npm or yarn.

Cheers and thank you again

r0lodex commented 9 months ago

I just read that you have a postinstall npm hook and that might be the reason it doesn't work with bun. I've tried with npm and yarn and it works fine.

r0lodex commented 9 months ago

For bun users — https://bun.sh/guides/install/trusted

Jarred-Sumner commented 9 months ago

As of Bun v1.0.17, the top 500 npm packages that use postinstall scripts are now run by default. Please try again with Bun v1.0.17 and let me know if you still run into this.

MorevM commented 9 months ago

@Jarred-Sumner well, I don't believe this package will ever be in the top 500 :D

@r0lodex does it work fine if you specify the package in trustedDependencies? I would write about it in the readme file

LokiWasHere commented 8 months ago

@MorevM I tried the trustedDependencies field & it works, thank's!

MorevM commented 7 months ago

I wrote a note about usage with Bun. Thank you guys for pointing that out :)