-
Notifications
You must be signed in to change notification settings - Fork 427
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
Unable to import the library in Create React App #1269
Comments
Did you recently switch to the NPM module? Are you using the CommonJS and the ES6 API from the readme? It looks like you aren't using the CommonJS version. That would give you |
Thanks for the reply. I tried using this library with a fresh
Then, I imported the
The error showed in the log was:
Thank you. |
I also tried the ES6 way.
which gave the result:
|
I'm guessing this is because CRA recently added support for ES6 modules but not other ES2015+ features this library uses, which means that DSR 0.8.7 would work prior to facebook/create-react-app#3776 being merged in. You might try an older version of CRA until I can figure out what to do. CRA can use modules, but not DSR's our
It's no long term solution, but if you hack it yourself and change For more info on our NPM module: |
Thank you interactivellama. I have found one way to workaround this issue by importing the components with In the meantime, I might find a way to have create-react-app to transpile the node_modules. |
You can get around this issue entirely by referencing the github repo in your
|
Thanks Todd. To everyone, here's the other code area to add to update https://github.com/salesforce/design-system-react/blob/master/scripts/dist.sh#L95 besides changing the The main question is where/what folder do we put a third copy or if there is another way around this? |
package.json 3c120d4#diff-b9cfc7f2cdf78a7f4b91a753d10865a2 I'm calling this fixed in latest realease, since the CJS modules work, but still looking at #1300 to implement ES6 modules as a feature. |
@nutchanon-pho Thank you, now the library is imported but someone please help me how to apply styles to the example button. Go and check bootstrap documentation > getting started guide. After trying many times then only I am writing this post. Even this post is old still you guys didn't fixed this. |
This is the worst installation guide I have seen so far for a popular lib. http://www.lightningdesignsystem.com/downloads/ |
@Randore What would help make the CRA readme more obvious? It's in the Table of Contents of the repo readme. Would a link on the doc site getting started page work? |
I came up with this error when trying to start a project from "create-react-app". This has never happened before until I updated the design-system-react to the latest version.
The text was updated successfully, but these errors were encountered: