-
Notifications
You must be signed in to change notification settings - Fork 5
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
The requested module does not provide an export named #2
Comments
Hi! I just tried it with a fresh vue3 + vite project and it works fine. Here's the one I made: https://codesandbox.io/p/devbox/vue-rewards-test-73q2ct |
Hello and thank you for your response. Unfortunately, it's impossible to get it to work at my place. Perhaps it's because I'm using the Quasar framework and their Vite plugin? |
This feels like a Quasar issue. Specifically, it would be unsurprising if this page were the ultimate resolution; I'm new to Quasar and new to Vue so this is all fairly puzzling. https://quasar.dev/app-extensions/tips-and-tricks/provide-a-ui-component/ @JohnyDyxt are you still struggling with this? There's at least TWO of us if so! (Update: I'm now using I took a swipe at it, no luck: app/src/boot/vue-rewards.js: import { boot } from 'quasar/wrappers';
import VueRewards, { useReward } from 'vue-rewards';
export default boot(({ app }) => {
app.config.globalProperties.$VueRewards = VueRewards;
app.config.globalProperties.$useReward = useReward;
});
export { useReward }; app/quasar.config.js: // app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot: [
...
'vue-rewards',
],
... Vue component where it's used: <script setup lang="ts">
...
import { useReward } from 'src/boot/vue-rewards';
const { reward: fullPageReward } = useReward('full-page', 'confetti', { startVelocity: 10, spread: 180, elementCount: 100 });
...
$q.notify({
color: 'green-4',
textColor: 'white',
icon: 'cloud_done',
message: 'Submitted',
onDismiss: () => {
fullPageReward();
ctaDialog.value = false;
}
}); |
Hi,
I got :
The requested module '/node_modules/vue-rewards/dist/vue-rewards.umd.cjs?import' does not provide an export named 'useReward'
Here's my code :
<script setup> import { useReward } from 'vue-rewards' const { reward: fullPageReward } = useReward('full-page', 'confetti', { startVelocity: 10, spread: 180, elementCount: 100 }) </script>CONFIG :
@quasar/[email protected]
[email protected]
Thank for helping
The text was updated successfully, but these errors were encountered: