vue-range-slider icon indicating copy to clipboard operation
vue-range-slider copied to clipboard

Navigator is not defined

Open CyrilDebon opened this issue 5 years ago • 2 comments
trafficstars

Hi, I tried to follow the nuxt usage of the component and made it worked and custom perfectly but when I want to refresh my page, I got a navigator is not defined. I'm working on nuxt and tried to follow the four steps but I don't really understand how to execute the step 3 and 4 of the guide. It's really sad that i have to give up on this well made and documented component !

CyrilDebon avatar Feb 26 '20 23:02 CyrilDebon

Ran into the exact same issue, also using Nuxt. I think this identifies the issue:

https://stackoverflow.com/questions/56319250/fixing-referenceerror-navigator-is-not-defined

You are trying to run code intended for a browser on the server

cobbie avatar Feb 27 '20 04:02 cobbie

This helped me https://github.com/NightCatSama/vue-slider-component/issues/114#issuecomment-353827607

But I had to wrap the component like this

<client-only>
            <vue-range-component
                :value="value"
                :min="min"
                :max="max"
                @input="onInput"
            />
</client-only>

olekon avatar Mar 30 '20 12:03 olekon