josephg / josephg/ShareJS

webclient files assume only CommonJS style modules would be present

Open
#352 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5k
Forks
454
PR merge metrics
No merged PRs in 30d

Description

When using the ShareJS web client files in an app that has separate AMD-style modules, `require` is defined, but `module.exports` is of course not. This results in a situation where ShareJS is doing things like `require('./microevent')`, even though no such module has been defined.

Checking for `require` is not sufficient to determine that CommonJS-style modules are present. It's probably better to check for both `require` and `module`.

The unfortunate temporary workaround for this is having to vendor in "webclient/share.js" and stick a `var require;` at the top of the IIFE.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.