Skip to content

Can't import jszmq into web browser #29

Open
@citkane

Description

@citkane

I want to try out jszmq in the browser, but am stumped at the fundamentals of getting it imported.

Server
Live Server from VS Code

Browser
Firefox for Ubuntu 101.0.1

Installation
npm install jszmq
version 0.1.2 gets installed

HTML code

<head>
        ...
	<script type="module" src="./main.js"></script>
</head

main.js

import * as zmq from '../node_modules/jszmq/lib/src/index.js';
console.log(zmq);

expected outcome:

The module would import without any shimming or boilerplating.
The zmq object would be logged to console.

actual outcome:

the below error is thrown to the console:

Uncaught ReferenceError: exports is not defined
    <anonymous> http://127.0.0.1:5500/node_modules/jszmq/lib/src/index.js:2
index.js:2:1

Can somebody please advise if I am missing a trick here?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions