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

[warn] duplicated imports #1

Closed
ibrunotome opened this issue Sep 25, 2023 · 4 comments
Closed

[warn] duplicated imports #1

ibrunotome opened this issue Sep 25, 2023 · 4 comments

Comments

@ibrunotome
Copy link

Your article is very good 🎉

Switching from the manual version to your package, I got this warnings:

WARN Duplicated imports "useSanctumAuth", the one from "/Users/.../node_module… will be ignored
│ WARN Duplicated imports "useSanctumClient", the one from "/Users/.../node_modu… will be ignored
│ WARN Duplicated imports "useSanctumUser", the one from "/Users/.../node_module… will be ignored

@manchenkoff
Copy link
Owner

Hey @ibrunotome, thanks 👍

Could you provide more details on how did you get this error? I tried to install it both in the fresh Nuxt project and one of my previous projects, but couldn't get this message. Both are on the Nuxt 3.7.

Do you have any files in your project with the same name?

@ibrunotome
Copy link
Author

Sure, Nuxt 3.7 here too. Im using your composables into the api layer and also in the .app

Screenshot 2023-09-25 at 17 05 26

The only mention of useSanctumClient in layers folder (with is outside the .app folder) is in the client plugin in api layer:

import type { ApiServiceContainer } from '../services/ApiServiceContainer'
import AuthenticationService from '../services/AuthenticationService'
import PasswordService from '../services/PasswordService'
import ProfileService from '../services/ProfileService'
import WorldService from '../services/WorldService'
import AnalysisService from '../services/AnalysisService'

export default defineNuxtPlugin(async (nuxtApp) => {
  const client = useSanctumClient()

  const api: ApiServiceContainer = {
    analysisService: new AnalysisService(client),
    authenticationService: new AuthenticationService(client),
    passwordService: new PasswordService(client),
    profileService: new ProfileService(client),
    worldService: new WorldService(client),
  }

  return { provide: { api } }
})

The mentions of useSanctumClient in may .app directory

Screenshot 2023-09-25 at 17 11 39

The project is using pnpm workspaces

packages:
  - .app
  - layers/*

@manchenkoff
Copy link
Owner

To be honest, I'm not familiar with pnpm workspaces, but it looks like this issue is not directly related to the package, but to Nuxt - nuxt/nuxt#13528 (comment), which leads to unjs/unimport#273. Could you please check the suggestions there and get back if something helped?

@ibrunotome
Copy link
Author

ibrunotome commented Sep 26, 2023

You're right, looks like is 100% related to unjs/unimport so I will close the issue. Thanks for your help.

[edit] unimport 3.4.0 release 2 hours ago fixed the warns :)

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