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

#195: RIPE SDK compatibility with Nuxt.js under Vercel #201

Merged
merged 10 commits into from
Oct 9, 2020

Conversation

BeeMargarida
Copy link
Contributor

@BeeMargarida BeeMargarida commented Sep 28, 2020

- -
Issue Closes #195
Dependencies --
Decisions Checks to see if it is using webpack and the window is not defined. If so, uses the npm packages. Uses __non_webpack_require__ to import xmlhttprequest, which is not defined by the webpack's require. This allows for no configuration in the ripe-sdk's clients, as well as almost no changes in the existing code.
References webpack/webpack#11455
https://stackoverflow.com/questions/46185302/non-webpack-require-is-not-defined
https://stackoverflow.com/questions/42797313/webpack-dynamic-module-loader-by-require
Animated GIF epir-papyrus with sdk, build with nuxt build --standalone and nuxt start:
Sep-28-2020 13-27-37

@BeeMargarida
Copy link
Contributor Author

@gcandal The solution found has a drawback, which is the need to add the config in the description to epir-papyrus and other services that use nuxt and the sdk.
Another option would be to not use the xmlhttprequest, by removing the added conditional, and only use fetch.

@BeeMargarida
Copy link
Contributor Author

@gcandal I ended up finding a solution here and here. This (using __non_webpack_require__) was the solution that allowed no try-catch modules, no changes in the existing code and no configuration in ripe-sdk clients.

Margarida Silva added 2 commits September 28, 2020 16:52
src/js/base/compat.js Outdated Show resolved Hide resolved
src/js/base/compat.js Outdated Show resolved Hide resolved
src/js/base/compat.js Outdated Show resolved Hide resolved
@gcandal gcandal assigned BeeMargarida and unassigned gcandal Sep 28, 2020
Margarida Silva added 2 commits September 29, 2020 09:15
@gcandal gcandal assigned joamag and unassigned gcandal Sep 29, 2020
@joamag joamag merged commit 59fc498 into master Oct 9, 2020
@joamag joamag deleted the ms/195-fix_sdk_nuxt_vercel branch October 9, 2020 13:02
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

Successfully merging this pull request may close these issues.

RIPE SDK not compatible with Nuxt.js under Vercel
3 participants