Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window.define clashes with requirejs #43

Open
maartenbreddels opened this issue Sep 15, 2023 · 0 comments
Open

window.define clashes with requirejs #43

maartenbreddels opened this issue Sep 15, 2023 · 0 comments

Comments

@maartenbreddels
Copy link

maartenbreddels commented Sep 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant