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

Webpack v4 jsonpFunction conflict #36

Open
portokallidis opened this issue Jul 8, 2021 · 2 comments
Open

Webpack v4 jsonpFunction conflict #36

portokallidis opened this issue Jul 8, 2021 · 2 comments

Comments

@portokallidis
Copy link

portokallidis commented Jul 8, 2021

This is to inform people who use webpack in their apps.
Webpack build configs with the default jsonpFunction name will not be able to use this library.
You will see something like this:
image

Solution
Modify your webpack output config like this:

{
   "output":{
      "jsonpFunction":"myAppJSONPcallback",
      "library":"myApp"
   }
}

Recommendation for Wolfram
You could apply the same config at your end so that this won't be an issue for others

@poeschko
Copy link
Contributor

poeschko commented Oct 4, 2021

Not sure what we can do on the library's end to avoid this. Note that we're using rollup.js for bundling the library, not webpack.

@portokallidis
Copy link
Author

portokallidis commented Oct 4, 2021

Sorry i havent put much effort in explaining the above use case.
It has nothing to do with the way this library is built.

I was referring to the bundled code in the Wolfram Public Cloud and the Wolfram Enterprise Private Cloud.
If you integrate the notebook embedder lib in a real life application which is bundled with Webpack then its most likely that it will conflict with the code fetched from Public Cloud or EPC (whatever is the source of the cloud notebook)
e.g. here is a sample js file fetched when trying to embed an example notebook from the public cloud.

Anyone trying to incorporate this lib into their apps will eventually run into this issue if they use Webpack and havent changed the default jsonp callback configuration.

This comment is to help people overcome this issue because at first we were clueless on how to debug this
or recommend Wolfram to update their webpack configuration to make the integration easier for others.

So the conflict arises due to the use of the default jsonp callback function name.

I hope i gave a better picture now

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

2 participants