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

Support package usage with Vite #149

Closed
2 tasks done
strife-cloud opened this issue Oct 15, 2023 · 3 comments
Closed
2 tasks done

Support package usage with Vite #149

strife-cloud opened this issue Oct 15, 2023 · 3 comments

Comments

@strife-cloud
Copy link

strife-cloud commented Oct 15, 2023

Describe the feature

Hey, I'm trying to use this package with nuxt3 but it feels like it doesn't work whenever I'm trying to do this

// nuxt.config.js

modules: [
  '@dargmuesli/nuxt-cookie-control'
],
cookieControl: {
  // typed module options
}

the typing is not recognized in this case

but in this case, it's recognized
// nuxt.config.js

modules: [
  ['@dargmuesli/nuxt-cookie-control', {
    // untyped module options
  }]
]

and in default.vue (my default layout)

<template>
  <CookieControl locale="en" />
</template>

<script setup lang="ts">
const {
  cookiesEnabled,
  cookiesEnabledIds,
  isConsentGiven,
  isModalActive,
  moduleOptions,
} = useCookieControl()
</script>

the component and the composable is not recognized maybe I'm missing some import ?

Here's my package.json

{
  "private": true,
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview"
  },
  "devDependencies": {
    "@dargmuesli/nuxt-cookie-control": "^6.4.5",
    "@nuxt/content": "^2.6.0",
    "@nuxt/image-edge": "^1.0.0-rc.1-28143901.afe4120",
    "@nuxtjs/tailwindcss": "^6.7.2",
    "@tailwindcss/typography": "^0.5.9",
    "@types/rss": "^0.0.30",
    "nuxt-simple-robots": "^3.0.2",
    "nuxt-simple-sitemap": "^3.0.9",
    "prettier": "^2.8.8",
    "rss": "^1.2.2",
    "vue-disqus": "^5.1.0",
    "vue-social-sharing": "^4.0.0-alpha4"
  },
  "dependencies": {
    "@gtm-support/vue-gtm": "^2.2.0",
    "@headlessui/vue": "^1.7.14",
    "@heroicons/vue": "^2.0.18",
    "nuxt": "^3.6.2"
  }
}

I'm using with vite not webback
node: 16.14.0

Any suggestion? Maybe I'm missing something

Additional information

  • Would you be willing to help implement this feature?

Final checks

@dargmuesli
Copy link
Owner

Hey, thank you for creating this issue. To verify that there is an actual issue, please use stackblitz.com to recreate the project as you're describing it here so it's done once and not by everyone who tries to debug the issue separately.

Regarding your issue: make sure to run a nuxi upgrade (or delete the lockfile and node_modules and reinstall all dependencies).

@strife-cloud
Copy link
Author

strife-cloud commented Oct 16, 2023

no worry, I didn't knew but I discover nuxt prepare who regenerate typescript file so the module is now discovered
We can close the issue

@dargmuesli
Copy link
Owner

Thanks for letting us know!

@dargmuesli dargmuesli closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2023
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