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

Fix: Create React App example results in error #1446

Merged
merged 4 commits into from
Nov 15, 2019

Conversation

tonyjmartinez
Copy link
Contributor

Ran into the following error preventing the CRA example from building:

./src/components/Placeholder.js 10:18
Module parse failed: Unexpected token (10:18)
You may need an appropriate loader to handle this file type.
|  */
| export default class Placeholder extends Component {
>       static propTypes = {
|               type: PropTypes.oneOf([
|                       'animal',

After updating the packages I ran into another error in the browser console resulting in errors in place of the component examples:

SyntaxError: Unexpected token (1:6)
    at _class.push../node_modules/buble/node_modules/acorn/dist/acorn.mjs.pp$4.raise (acorn.mjs:3605)
    at _class.push../node_modules/buble/node_modules/acorn/dist/acorn.mjs.pp.unexpected (acorn.mjs:838)
    at _class.jsx_parseIdentifier (index.js:287)
    at _class.jsx_parseNamespacedName (index.js:297)
    at _class.jsx_parseAttribute (index.js:377)
    at _class.jsx_parseOpeningElementAt (index.js:391)
    at _class.jsx_parseElementAt (index.js:415)
    at _class.jsx_parseElement (index.js:478)
    at _class.parseExprAtom (index.js:483)
    at 

I found that installing dependencies with yarn got past the issue. So I updated the readme with yarn as a suggested alternative.

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the package updates!

"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build"
}
"name": "react-styleguidist-example-cra",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert the indentation changes.

@@ -7,7 +7,7 @@ How to start locally:
```
git clone https://github.com/styleguidist/react-styleguidist.git
cd react-styleguidist/examples/cra
npm install
npm install (or yarn install)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't make sense to make this change in just one example, and I'm sure the issues isn't related to npm/yarn. They both install the same packages. Also now you can't copy the code and paste it into the terminal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. I thought it might be related to #1321 since it only worked when I used yarn.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be some minor differences in version resolution between npm and Yarn. But you can't say that using Yarn actually fixes the issue. Tomorrow it could be the opposite.

@sapegin
Copy link
Member

sapegin commented Nov 6, 2019

Could you please merge master, it should fix the CI failures?

@codecov-io
Copy link

Codecov Report

Merging #1446 into master will decrease coverage by 0.05%.
The diff coverage is n/a.

Impacted Files Coverage Δ
src/client/utils/handleHash.js 92.3% <0%> (-3.85%) ⬇️
src/client/rsg-components/Playground/Playground.js 93.93% <0%> (-2.84%) ⬇️
...nt/rsg-components/ReactComponent/ReactComponent.js 85.18% <0%> (-2.82%) ⬇️
src/client/utils/getUrl.js 96.29% <0%> (-0.68%) ⬇️
.../rsg-components/TableOfContents/TableOfContents.js 95.83% <0%> (-0.17%) ⬇️
src/client/rsg-components/Slot/Slot.js 95.45% <0%> (ø) ⬆️
...s/ExamplePlaceholder/ExamplePlaceholderRenderer.js 100% <0%> (ø) ⬆️
...ient/rsg-components/TabButton/TabButtonRenderer.js 100% <0%> (ø) ⬆️
src/client/rsg-components/StyleGuide/StyleGuide.js 100% <0%> (ø) ⬆️
...client/rsg-components/ReactExample/ReactExample.js 100% <0%> (ø) ⬆️
... and 54 more

@tonyjmartinez
Copy link
Contributor Author

Could you please merge master, it should fix the CI failures?

@sapegin Done. Sorry it took me so long!

@sapegin sapegin merged commit 933c175 into styleguidist:master Nov 15, 2019
@sapegin
Copy link
Member

sapegin commented Nov 15, 2019

Thanks!

@styleguidist-bot
Copy link
Collaborator

🎉 This PR is included in version 10.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants