How can I solve react-select library issue with CDN
I finished an exchange rate getter application. It works perfectly using node_modules. The problem is I cannot seem to grab the correct CDNs for one of the libraries. That library is called "react-select". Current version of react-select is "3.1.0".
React-Select is a highly configurable dropdown library for React.
The react-select project:
The site where i pick my CDNs is:
This is the page for react-select:
The problem is I've already tried all of them and none of the combinations seem to work. The errors I get in the console are pretty obvious (example of 2 of them below):
Uncaught ReferenceError: require is not defined at react-select.cjs.dev.min.js:1
Uncaught ReferenceError: exports is not defined at react-select.browser.cjs.min.js:1
I can't seem to understand why is it giving me this error since i import the scripts through the CDN, and i don't use the 'require' and 'export' keywords anywhere in the code
An short example of the code is here, and contains all the CDN combinations i have tried (browser, prod and dev) normally i would go with the prod version, but in this case i wanted to see if the others work. none of them did.
The reason why there are more than a single CDN is that react-select requires multiple dependencies to work.
The react-select is a npm package with common.js which is written for node.js execution. To make it run from browser, we have to bundle a new js file using browserify or webpack tools.
The react-select requires many external libraries before it can run without error. To check for the dependency, you can run command "npm list", you would discover very long list of required library packages for this react-select.
Calviղ, David Carroll, Burey, BENOTMANE
i'm terribly sorry for disturbing you guys with something so small, but if you can have a quick look i would appreciate it beyond compare!
if it cannot be done it's fine, i will start building a personal dropdown just to be able to run it in sololearn.
Sebastian Pacurar No need to apologize. I'm always up for reviewing an interesting challenge. However, I may not be able to take a look until later tonight. About to go for a run and have dinner later. 😉