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 to resolve import @morev/vue-transitions/styles using Nuxt 3 #254

Closed
r0lodex opened this issue Dec 9, 2023 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@r0lodex
Copy link

r0lodex commented Dec 9, 2023

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

  • Added the package with bun add @morev/vue-transitions/nuxt
  • Added into Nuxt's modules
// nuxt.config.ts
modules: [
    ...
    "@morev/vue-transitions/nuxt",
  ],
  • Use it is any of view files e.g Test.vue
<TransitionSlide :offset="[-16, 0]">
    content
</TransitionSlide>

Environment

  • Device: 2019 16" MBP (Intel)
  • OS: Sonoma 14.2

Additional context

No response

Possible solution

Possibly updating the package to have the styles imported properly.

@r0lodex r0lodex added the bug Something isn't working label Dec 9, 2023
@MorevM
Copy link
Owner

MorevM commented Dec 9, 2023

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
Copy link
Author

r0lodex commented Dec 9, 2023

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
Copy link
Author

r0lodex commented Dec 9, 2023

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
Copy link
Author

r0lodex commented Dec 10, 2023

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

@Jarred-Sumner
Copy link

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
Copy link
Owner

MorevM commented Dec 23, 2023

@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
Copy link

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

@MorevM
Copy link
Owner

MorevM commented Feb 18, 2024

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

@MorevM MorevM closed this as completed Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants