eligrey / eligrey/FileSaver.js

Problem with ngUniversal

Open
#563 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
22k
Forks
4.3k
PR merge metrics
No merged PRs in 30d

Description

I have a problem with HTMLAnchorElement appeared in file-saver above v2.0.0-rc.4.

When I try to make a prerender using ngUniversal I receive this error:

```
/path/to/project/dist/server.js:225854
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
else {}})(this,function(){"use strict";
function b(a,b){return"undefined"==typeof b?b={autoBom:!1}:"object"!=typeof b&&(console.warn("Depricated: Expected third argument to be a object"),b={autoBom:!b}),b.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;
.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function c(b,c,d){var e=new XMLHttpRequest;e.open("GET",b),e.responseType="blob",e.onload=function(){a(e.response,c,d)},e.onerror=function(){console.error("could not download file")},e.send()}function d(a){var b=new XMLHttpRequest;
return b.open("HEAD",a,!1),b.send(),200<=b.status&&299>=b.status}function e(a){try{a.dispatchEvent(new MouseEvent("click"))}catch(c){var b=document.createEvent("MouseEvents");
b.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(b)}}var f="object"=

ReferenceError: HTMLAnchorElement is not defined
at Object. (/path/to/project/dist/server.js:225854:1182)
```

I found the same problem described here: https://stackoverflow.com/questions/54156508/angular-7-webpack-server-side-rendering-creates-referenceerror-htmlanchorelemen

Can you help me to find out? What could changed related to HTMLAnchorElement in v2.0.0?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.