question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I tried to use this as plugin in Nuxt. I have created currency.js under plugins/ folder.

// plugins/currency.js

import VueCurrencyFilter from 'vue-currency-filter'
import Vue from 'vue'

Vue.use(VueCurrencyFilter)

and include the script in nuxt.config.js

// nuxt.config.js

module.exports = {
    plugins: [
        { src: '~/plugins/currency.js', ssr: false }
    ]
}

and inside my component at components/ProductCard.vue

// components/ProductCard.vue
<template>
    <h4>{{ price | currency }}</h4>
</template>
<script>
    import currency from '~/plugins/currency.js'

    export default {
        ...
    }
</script>

This resulted error as below

[Vue warn]: Failed to resolve filter: currency

(found in <ProductCard> at components/ProductCard.vue)

Any workaround how to use this on Nuxt?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:19 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
Jozagutscommented, Sep 22, 2020

my environment Nuxt.js @ v2.14.6 I change
{ src: ‘~/plugins/currency’, ssr: true } <–change to true and everything works

1reaction
danchristiancommented, Jan 18, 2019

I just updated to "vue-currency-filter": "^3.2.1" and still get that error message unfortunately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 reasons to use Nuxt.js for your next web application - Medium
Nuxt.js is a higher-level framework that builds on top of Vue. It simplifies the development of universal or single page Vue apps. Nuxt.js ......
Read more >
Nuxt.js over Vue.js: when should you use it and why | Bornfight
Nuxt.js is a frontend framework built upon Vue.js that offers great development features such as server side rendering, automatically generated ...
Read more >
When should you Use Nuxt.js instead of Vue.js?
Nuxt.js enables developers to build Server Side Rendered applications in which a Node.js server will deliver HTML to the client based on your ......
Read more >
Axios usage - Nuxt
Axios usage. In the first example we show how to use the env property in our nuxt.config.js file to add the URL of...
Read more >
Nuxt - The Intuitive Vue Framework
Build your next Vue.js application with confidence using Nuxt. An open source framework making web development simple and powerful.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found