Skip to content

window.define clashes with requirejs #43

Description

@maartenbreddels

When the widget manager is loaded, and window.define is available due to:

(window as any).define = this.define.bind(this);

RequireJS does an early exit: https://github.com/requirejs/requirejs/blob/898ff9e60eb6897500720151c0b488b8749fbe8d/require.js#L177

which means requirejs and require are undefined.

A few questions:

  • Why is window.define define this way what is its purpose?
  • Which code uses this define, for instance is this needed to make 3rd party widget libraries work?
  • Can it be removed, so requirejs works normally, or would this break things?
  • Should window.define not be overwritten when it already exists?

The answers to these questions will give us a better idea if widgetti/solara#292 is a correct fix or not.

Regards,

Maarten

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