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.

UMD module not added to global/window in browser

See original GitHub issue

The UMD module if statement doesnt fall back to adding itself to the global variable (window in the browser).

This is the fallback that is missing (from the umdjs repo example): https://github.com/umdjs/umd/blob/master/templates/returnExports.js#L26-L29

Also, how come the different versions arent added side by side in the latest version (with a .umd.js suffix for example) and instead have their own version?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
emattiascommented, Apr 17, 2020

Yeah I just wanted to offer the pr. You are of course free to close it if you dont want to offer UMD modules 😃

0reactions
inorganikcommented, Apr 28, 2020

This is now merged, UMD module is available in ./dist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

umd module compiler option doesn't have a fallback for global ...
I was disappointed when I saw my UMD module did not work in browser. Standard or not, UMD means something to web developers...
Read more >
Why do I need to set global.window when using UMD in Node?
But when I want to use it in a node script I have to declare window first like this... // WTF global.window =...
Read more >
Add Rollup Configuration | Building an NPM Package with ...
Add Rollup Configuration | Building an NPM Package with TypeScript. First, let's explain what ES modules / Commonjs / IIFE / UMD are....
Read more >
The struggles of publishing a JavaScript library - Nolan Lawson
One way this might manifest itself is that you expect a global window variable to exist in the browser – but oh no,...
Read more >
javascript global is not defined - You.com | The AI Search ...
declare module '@walletconnect/web3-provider/dist/umd/index.min.js' ... Angular 7: Uncaught ReferenceError: global is not defined when adding package.
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