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.

NodeJs, increase compatibility

See original GitHub issue

# RollUp Rollup modifies the Code resulting into potential breaks for jspdf.

jspdf.js (2172:84) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/cf-blob.js/Blob.js (211:84) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/cf-blob.js/Blob.js (211:100) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
node_modules/file-saver/FileSaver.js (176:4) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
libs/deflate.js (2056:3) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
libs/png_support/png.js (469:46) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
libs/polyfill.js (196:85) The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
The following options have been renamed — please update your config: moduleName -> name

E.g. in Blob.js }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));

https://github.com/eligrey/Blob.js/blob/master/Blob.js

Will be changed to }(typeof self !== "undefined" && self || typeof window !== "undefined" && window || undefined.content || undefined));

obviously results into breaks in nodejs, wenn undefined.content is tried to be solved, which results in an error.

Various calls of window-Object in jspdf should be removed or made compatibly with node.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Uzlopakcommented, Feb 18, 2018

All bugs and bugfixes, which are mentioned here, have been solved or are beeing applied to master branch.

Will be in next release.

0reactions
Uzlopakcommented, Feb 17, 2018

buenjybar wrote:

hi. try to simulate browser’ s global variables

const debug = require(‘debug’)(‘my-namespace’) global.console = {}; global.navigator = {}; global.console.error = debug; global.console.log = debug; global.window = {};

var jsPDF = require(‘./jspdf’); global.jsPDF = jsPDF;

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compatibility and requirements for the Node.js agent
The Node.js agent is compatible with the following operating systems: Linux; SmartOS; macOS 10.7 and higher; Windows Server 2008 and higher The following...
Read more >
ABI Stability | Node.js
The JavaScript language has remained compatible with itself since its very early days, whereas the ABI of the engine executing the JavaScript code...
Read more >
Node.js Compatibility Requirements - Datadog Docs
When the Node.js project drops support for an LTS major release line (when it goes EOL), support for it is dropped in the...
Read more >
D3 7.0 to boost compatibility with Node.js by going all-in on ...
Popular data visualisation library D3 7.0 is now available, improving compatibility with JavaScript runtime environment Node.js.
Read more >
Node.js compatibility in Deno | The JS runtimes - Medium
The biggest enhancement is to bring in the std's node module in the core runtime through a flag ( — compat). This way,...
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