question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ReferenceError: Element is not defined

See original GitHub issue

Here is the error log while hit npm run serve:ssr

var matchesMethod = Element.prototype.matches ||       
                        ^

ReferenceError: Element is not defined
    at D:\projects\yra\dist\server\main.js:141177:25       
    at Vz3n (D:\projects\yra\dist\server\main.js:141078:13)
    at Object.Vz3n (D:\projects\yra\dist\server\main.js:141080:2)
    at __webpack_require__ (D:\projects\yra\dist\server\main.js:20:30)
    at Module.UUxd (D:\projects\yra\dist\server\main.js:138834:76)
    at __webpack_require__ (D:\projects\yra\dist\server\main.js:20:30)
    at Object.sZXh (D:\projects\yra\dist\server\main.js:220458:12)
    at __webpack_require__ (D:\projects\yra\dist\server\main.js:20:30)
    at Object.gnUf (D:\projects\yra\dist\server\main.js:180589:12)

Dependencies are:

dependencies": {
    "@angular/animations": "~8.2.13",
    "@angular/common": "~8.2.13",
    "@angular/compiler": "~8.2.13",
    "@angular/core": "~8.2.13",
    "@angular/forms": "~8.2.13",
    "@angular/platform-browser": "~8.2.13",
    "@angular/platform-browser-dynamic": "~8.2.13",
    "@angular/platform-server": "~8.2.13",
    "@angular/router": "~8.2.13",
    "@auth0/angular-jwt": "^3.0.0",
    "@fullcalendar/angular": "^4.3.1",
    "@fullcalendar/core": "^4.3.1",
    "@fullcalendar/daygrid": "^4.3.0",
    "@fullcalendar/interaction": "^4.3.0",
    "@fullcalendar/list": "^4.3.0",
    "@fullcalendar/moment": "^4.3.0",
    "@fullcalendar/timegrid": "^4.3.0",

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
acerixcommented, Jul 20, 2020

Sorry for the delay in responding to your issue, I have just begun triaging on this repo.

I believe this existing ticket captures this need: https://github.com/fullcalendar/fullcalendar/issues/4784 ↑ Please visit the above issue, give a 👍 to vote (?), press the 🔈Subscribe button to receive updates.

If there is another issue, please post a runnable, stripped-down demonstration.

0reactions
rajaunleashedcommented, Apr 17, 2021

Hi @acerix I tried your code in server.ts but still the same error. See the error in the Screenshot https://prnt.sc/11kp43c

Temporary I fix it remove the element code from main.js but whenever again I create SSR build it arises again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`ReferenceError: Element is not defined` when running mocha ...
onsenui seems to be written for a browser enviroment, whilst you're executing it in a nodejs enviroment. Element is a DOM api. nodejs...
Read more >
ReferenceError: Element is not defined · Issue #6610 - GitHub
The issue is that rollup removes unused code. It considers adding const Element = typeof Element === "undefined" ? function () {} :...
Read more >
ReferenceError: "x" is not defined - JavaScript - MDN Web Docs
ReferenceError : "x" is not defined. The JavaScript exception "variable is not defined" occurs when there is a non-existent variable referenced somewhere.
Read more >
React UIKit v3 error - ReferenceError: Element is not defined
Hello, I'm upgrading React UIKit from v2 to v3 and got an error message ReferenceError: Element is not defined.
Read more >
ReferenceError: Element is not defined` when running mocha ...
onsenui seems to be written for a browser enviroment, whilst you're executing it in a nodejs enviroment. Element is a DOM api. nodejs...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found