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 builds not working on import

See original GitHub issue

Expected behavior: I’m trying to implement react-jss via CDN. Importing the UMD build via <script> tag should work out of the box.

Describe the bug: The module does not load and the console generates the error as follows:

Uncaught ReferenceError: module is not defined
    at react-jss.min.js:6
    at react-jss.min.js:1
    at react-jss.min.js:1

Reproduction:

CodeSandbox - loading react, react-dom, and react-jss

Versions:

  • jss: 10.8.1
  • browser: any

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
TrySoundcommented, Oct 21, 2021

React packages use object-assign

0reactions
GeorgeNagelcommented, Jul 18, 2022

This is still an issue as of 10.9.1-alpha.2. Still getting an issue as a result of object-assign.

<script src="https://unpkg.com/react-jss@10.9.1-alpha.2/dist/react-jss.js" crossorigin></script>

I believe this is the package that is generating the error https://github.com/sindresorhus/object-assign

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 5 cannot import UMD module - Stack Overflow
During the build, webpack gives me a warning: export 'default' (imported as 'L') was not found in 'leaflet' (possible exports: ) . When...
Read more >
rollup.js
As you build more complex bundles, you'll often need more flexibility – importing modules installed with NPM, compiling code with Babel, working with...
Read more >
Features | Vite
Pre-bundle them to improve page loading speed and convert CommonJS / UMD modules ... Use the Type-Only Imports and Export syntax to avoid...
Read more >
Output - webpack
webpack will not write output file when file already exists on disk with the same ... To make UMD build available on both...
Read more >
How to Dynamically Import JavaScript with Import Maps
To solve that problem, you'll need a new tool called import maps . ... A major difference is that unlike the ES imports,...
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