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.

Issue with rollup

See original GitHub issue

Installed via npm tried import {Diff2Html} from 'diff2html;

but get

path (imported by node_modules/diff2html/src/hoganjs-utils.js, commonjs-external:path) (!) Missing global variable name Use output.globals to specify browser global variable names corresponding to external modules path (guessing ‘path’)

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
geraldpereiracommented, Aug 28, 2018

I found a better solution.

I simply include the diff2html files in angular.json:

"scripts": [
              "node_modules/diff2html/dist/diff2html.min.js"
            ],

( you may also need to add the css, I use my own to handle the resizing of the diff container using flexbox).

And keep importing the Diff2Html from the window object: const Diff2Html = (window as any).Diff2Html

0reactions
thodoriscommented, Dec 7, 2018

Sorry I’m bumping up the old thread, I am having the same issue when using with typescript.

Importing this library in TypeScript (import {Diff2Html} from 'diff2html;) always ended in compilation issues because of the var path = require('path'); line in the file hoganjs-utils.js.

@geraldpereira Can you elaborate why does typescript give an error in this line? Does it need additional typings for this? I’d be willing to make an effort to fix this, but I’m not sure I understand what’s causing typescript to give error.

@shileen It has nothing to do with typings. Just do a : npm install path

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues · rollup/rollup - GitHub
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the...
Read more >
How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Rollup is a next-generation JavaScript module bundler. Author your app or library using ES2015 modules, then efficiently bundle them up into a single...
Read more >
Problem with rollup dev server crashing in svelte 3
I suspect this is caused by the plugin rollup-plugin-livereload which attempts to watch the public folder for changes. There are too many files ......
Read more >
Issues with Rollups Not Running in Real Time - YouTube
Rollup Helper is meant to be easy to set up and use, but in this series of Troubleshooting Tip videos, I'll review the...
Read more >
October 12, 2021—KB5006714 (Monthly Rollup)
Learn more about this security update, including improvements and fixes, any known issues, and how to get the update. Important: Windows 8.1 and ......
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