Configuring Nuxt's Client Side
Promise.withResolve is not a function
with Nuxt
The Vue PDF Viewer component currently does not support server-side rendering. This means you cannot use Vue PDF Viewer as a server component. In Nuxt, you might encounter the error Promise.withResolve is not a function
. To resolve this issue, please choose one of the methods:
- Register Vue PDF Viewer for Auto-import: Register Vue PDF Viewer in a local module and use Nuxt's auto-import feature to ensure it loads only on the client
- Create a Client Component: Define your client component with a
.client
suffix to enforce client-side rendering - Directly import and use it in
<ClientOnly>
Tag: Wrap the Vue PDF Viewer component within<ClientOnly>
to ensure it only renders on the client side
For examples of each method, please refer to the Nuxt section of Basic Usage
.