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

Not support SSR #9

Open
lanaambre opened this issue Jan 4, 2018 · 14 comments
Open

Not support SSR #9

lanaambre opened this issue Jan 4, 2018 · 14 comments

Comments

@lanaambre
Copy link

It seems this package doesn't work with Server Side Rendering project:

ReferenceError: window is not defined
    at /path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:28820
    at /path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:28752
    at t.exports (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:29170)
    at Object.<anonymous> (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:29627)
    at e (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:177)
    at Object.module.exports.Object.defineProperty.value (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:9659)
    at e (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:177)
    at Object.module.exports.Object.defineProperty.value (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:9804)
    at e (/path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:177)
    at /path/to/project/node_modules/vue-perfect-scrollbar/dist/index.js:1:566
@Degfy
Copy link
Collaborator

Degfy commented Jan 10, 2018

yes. i plan support it in 1.x which will depend on perfect-scrollbar 1.x

@Degfy
Copy link
Collaborator

Degfy commented Jan 20, 2018

@Antoine-Demailly i have no time to finish 1.x recently.however i submitted a commit for ssr in the repo,maybe you can test it. i will publish it if no bug.

@mavrick
Copy link

mavrick commented Feb 19, 2018

@Degfy - i tested with nuxtjs using the 1.x branch and ssr - working fine. thank you

@byrnane
Copy link

byrnane commented Mar 19, 2018

So... If you fixed it, how can i get updated version?

@dillonburns
Copy link

@byrnane here you go, I got it by going to the <>code tab, changing the branch to 1.x and downloading it from there.

@TAnas0
Copy link

TAnas0 commented Jul 19, 2018

@Degfy With the rise of Nuxt.js and Server Side Rendering in general, could you please update the package on NPM?
Just for a cleaner install and since the version 1.0 is already ready, I suppose. If not, let us know what we can do to help.

Cheers

@TAnas0
Copy link

TAnas0 commented Jul 19, 2018

It is worth noting that you can install the version 1.0 of vue-perfect-scrollbar using:

npm install git+https://github.com/Degfy/vue-perfect-scrollbar.git#1.x

@LanFeusT23
Copy link

Is it completed though or still in dev? Hasn't been touched in 7 months.

@creativenoobie
Copy link

@Degfy Hey, Any updates on this? NPM package version is still 0.1.0.

@leafiy
Copy link

leafiy commented Feb 24, 2019

you need nuxt plugin

@PaddeK
Copy link

PaddeK commented Apr 26, 2019

I kind of solved it with a hack until this issue is resolved

require('require-extension-hooks')('js').push(({filename, content}) => {
    if (filename.endsWith('/node_modules/vue-perfect-scrollbar/dist/index.js')) {
        return ['!process.client && require("browser-env")()', content].join('\n');
    }
});

Put this in the nuxt app entry /server/index.js

@AlperMehmetOzdemir
Copy link

It is worth noting that you can install the version 1.0 of vue-perfect-scrollbar using:

npm install git+https://github.com/Degfy/vue-perfect-scrollbar.git#1.x

When I run this npm can't seem to find the file. Do I have to manually download from github and add to node modules and update my package.json?

@woothu
Copy link

woothu commented Sep 4, 2019

@Degfy can you tell when SSR will be available?

@woothu
Copy link

woothu commented Jun 19, 2020

For everyone searching for this silution try out CScrollbar component from '@coreui/vue' library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests