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

i got error when run npm run dev:ssr #263

Open
Mangdar opened this issue Jul 10, 2020 · 17 comments
Open

i got error when run npm run dev:ssr #263

Mangdar opened this issue Jul 10, 2020 · 17 comments

Comments

@Mangdar
Copy link

Mangdar commented Jul 10, 2020

D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:171203
Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [WheelEvent]),
^

ReferenceError: WheelEvent is not defined
at Module../node_modules/ngx-drag-scroll/ivy_ngcc/fesm2015/ngx-drag-scroll.js (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:171203:84)
at webpack_require (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:26:30)
at Module../src/app/sharing/sharing.module.ts (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:195456:73)
at webpack_require (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:26:30)
at Module../src/app/app.module.ts (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:193446:82)
at webpack_require (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:26:30)
at Module../src/app/app.server.module.ts (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:193565:69)
at webpack_require (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:26:30)
at Module../src/main.server.ts (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:200059:80)
at webpack_require (D:\Workspace\Frontend\whitesidev2\dist\whitesidev2\server\main.js:26:30)

@blasco
Copy link

blasco commented Jul 21, 2020

Same here, it started happening after upgrading to version 9. For the moment you can roll back to 8.0.0-beta.2 to make it work with angular universal. It shows a warning though, but at least it doesn't break:

[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

@blasco
Copy link

blasco commented Aug 11, 2020

Any news on this?

@bfwg
Copy link
Owner

bfwg commented Aug 11, 2020

hi @blasco , I haven't got a chance to look into this. If you know the solution, feel free to submit a PR.

@blasco
Copy link

blasco commented Sep 2, 2020

@bfwg Thank you for the great work. Unfortunately I have no clue what is causing the issue, for the moment I'm staying with 8.0.0-beta.2 version.

@Bidthedog
Copy link

I'm getting this issue after upgrading to Angular 10 also, mind you, I couldn't tell you if it was working previously as I've also recently migrated to using SSR / Universal, so it could have been there for v8.x too.

I've done a bit of investigation, and this occurs whenever I include a ViewChild in my component as follows:

  @ViewChild('techList', { read: DragScrollComponent, static: true })
  public techList: DragScrollComponent;

I need this to be able to access currIndex for implementing custom scrolling.

Full error below:

D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:148026
    Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__metadata"])("design:paramtypes", [WheelEvent]),
                                                                                   ^

ReferenceError: WheelEvent is not defined
    at Module../node_modules/ngx-drag-scroll/__ivy_ngcc__/fesm2015/ngx-drag-scroll.js (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:148026:84)
    at __webpack_require__ (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:20:30)
    at Module../src/app/shared/tech-list/tech-list.component.ts (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:173198:73)
    at __webpack_require__ (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:20:30)
    at Module../src/app/pages/home/home.component.ts (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:170431:95)
    at __webpack_require__ (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:20:30)
    at Module../src/app/app-routing.module.ts (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:168308:84)
    at __webpack_require__ (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:20:30)
    at Module../src/app/app.module.ts (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:168754:77)
    at __webpack_require__ (D:\Git\Personal\ShadowMosesWebsite\src\SMD.Web\dist\smdweb\server\main.js:20:30)

A server error has occurred.
node exited with 1 code.

@blasco
Copy link

blasco commented Oct 7, 2020

Any updates on this? Thank you again

@bfwg
Copy link
Owner

bfwg commented Oct 7, 2020

@blasco I'll try to find time today and take a look. Can you provide a piece of code demo using https://plnkr.co/, or just steps to reproduce this?

@MarcGilbertSparte
Copy link

We've got the same issue with 9.0.0-beta.4, works with 8.0.0-beta.2.

Great package btw thank you for your work !

@blasco
Copy link

blasco commented Oct 22, 2020

@bfwg Sorry I haven't been able to set up a demo. The steps to reproduce are simple, just deploy a Angular Universal app and try to use the component, it will fail with the latest version.

@tonnystark
Copy link

I got the same issue.

@blasco
Copy link

blasco commented Jan 13, 2021

Any progress with this, is it solved with angular 11?

@blasco
Copy link

blasco commented Jan 13, 2021

I think the solution could be to use this to isolate the browser dependent code:

import { ..., PLATFORM_ID, ... } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';


constructor(
    @Inject(PLATFORM_ID) private platformId: Object,
){
    if (isPlatformBrowser(this.platformId)) {
       // MouseEvent code
    }
}

@bfwg
Copy link
Owner

bfwg commented Jan 23, 2021

@blasco do you have a working solution?

@blasco
Copy link

blasco commented Jan 24, 2021

@bfwg Unfortunately not, I'm just stuck with version 8.0.0 which seems to work for Angular 11 and SSR. This is the best gallery solution for angular out there, I wish you could have more support to fix these small issues.

@blasco
Copy link

blasco commented Jun 11, 2021

Hi, has this been solved by any chance? Is it safe to update to the latest version? Thank you in advance for your outstanding work!

@bfwg
Copy link
Owner

bfwg commented Jun 13, 2021

hi @blasco , would you mind running dev:ssr on the example app and tell me what you see?

@MilotH2
Copy link

MilotH2 commented Oct 31, 2021

I am facing the same issue. EDIT: I can confirm, after I deleted this I can proceed without that error.

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

7 participants