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

Knob replaceAll causes issue with nuxt SSR #844

Closed
elliottross23 opened this issue Jan 8, 2021 · 5 comments
Closed

Knob replaceAll causes issue with nuxt SSR #844

elliottross23 opened this issue Jan 8, 2021 · 5 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Milestone

Comments

@elliottross23
Copy link

I'm trying to use primevue in NuxtJS with SSR and have it working but the Knob component throws the error this.valueTemplate.replaceAll is not a function

Since replaceAll is not available in browser javascript this line could be replaced with this.valueTemplate.replace(/{value}/g, this.value); and would then work in both nodejs and browser environments.

@cagataycivici cagataycivici self-assigned this Jan 20, 2021
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jan 20, 2021
@cagataycivici cagataycivici added this to the 3.2.0-rc.1 milestone Jan 20, 2021
@cagataycivici
Copy link
Member

Fixed for v3, will be ported to v2 as well. Thank you.

@thearabbit
Copy link

+1

@JohannesSchwegler
Copy link

I'm trying to use primevue in NuxtJS with SSR and have it working but the Knob component throws the error this.valueTemplate.replaceAll is not a function

Since replaceAll is not available in browser javascript this line could be replaced with this.valueTemplate.replace(/{value}/g, this.value); and would then work in both nodejs and browser environments.

how did you set it up? i get an error when i run it with ssr: true

@elliottross23
Copy link
Author

@JohannesSchwegler here's the relevant parts of my nuxt.config.js

I'm using "nuxt": "^2.14.6" in my package.json

export default {
   target: 'server',
   ssr: true,
   modules: ['primevue/nuxt'],
   build: {
      transpile: ['primevue']
   },
   primevue: {
      theme: 'saga-blue',
      ripple: true,
      components: [/* What components you want */]
   }
}

@thearabbit
Copy link

@elliottross23, very thanks. It work fine for me too.

"nuxt": "^2.15.3"
"primevue": "^2.4.0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working vue2-portable
Projects
None yet
Development

No branches or pull requests

4 participants