Does not work as a traditional JS resource – Uncaught ReferenceError: module is not defined
See original GitHub issueHello, this looks like a very handy library. However, I’m having trouble using it without using it as an ES-module.
My source code:
<script src="https://unpkg.com/quicklink@0.1.2/dist/quicklink.js"></script>
<script>
quicklink();
</script>
The output:
quicklink.js:1 Uncaught ReferenceError: module is not defined
at quicklink.js:1
(anonymous) @ quicklink.js:1
(index):142 Uncaught ReferenceError: quicklink is not defined
at (index):142
Expected result I would expect it to work since the readme says so.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
ReferenceError: module is not defined - Stack Overflow
So i have been trying to run this web ...
Read more >Javascript, Uncaught ReferenceError: module is not defined
I've made a little program using JS and at the bottom I have: module.exports = functions; This is so that I can use...
Read more >The JavaScript Modules Handbook – Complete Guide to ES ...
A JavaScript module is a file that allows you to export its code. ... So, it would not work in a function, for...
Read more >Scoping with vanilla JS ES modules - Go Make Things
js // This will throw an error: // Uncaught ReferenceError: answer is not defined console.log(answer);. Similarly, you cannot access the name ...
Read more >require is not defined in javascript - You.com | The AI Search ...
You are trying to run it in the browser, where it isn't supported and does not work. You need to run it in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, for browser/UMD usage thru unpkg.com, you should use this asset:
https://unpkg.com/quicklink@0.1.2/dist/quicklink.umd.js
The one you requested is the Node/CommonJS version
For sure, will do – thanks!