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

Support for the experimental syntax 'jsx' isn't currently enabled (18:10) #149

Closed
alindsay55661 opened this issue Jan 13, 2021 · 1 comment

Comments

@alindsay55661
Copy link

This course is beginning to feel like a Linux build, nothing works out of the box.

    ▶️  Starting: Project Validation
          Running validation checks to ensure dependencies were installed properly
          Running the following command: npm run validate -s
Determining test suites to run...(node:7844) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at X:\projects\learning\epic-react\react-fundamentals\node_modules\postcss-safe-parser\node_modules\postcss\package.json. 
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)

 PASS  src/__tests__/06.js        
 PASS  src/__tests__/06.extra-3.js
 PASS  src/__tests__/05.js
 PASS  src/__tests__/06.extra-2.js
 PASS  src/__tests__/07.js        

Test Suites: 5 passed, 5 total
Tests:       5 passed, 5 total
Snapshots:   0 total
Time:        7.146 s
Ran all test suites.
Failed to compile.

X:/projects/learning/epic-react/react-fundamentals/src/exercise/01.md (X:/projects/learning/epic-react/react-fundamentals/node_modules/babel-loader/lib!X:/projects/learning/epic-react/react-fundamentals/node_modules/mdx-loader!X:/projects/learning/epic-react/react-fundamentals/src/exercise/01.md)
SyntaxError: X:\projects\learning\epic-react\react-fundamentals\src\exercise\01.md: Support for the experimental syntax 'jsx' isn't currently enabled (18:10):

  16 |   ...props
  17 | }) {
> 18 |   return <MDXLayout {...layoutProps} {...props} components={components} mdxType="MDXLayout">
     |          ^
  19 |     <h1 {...{
  20 |       "id": "basic-javascript-rendered-hello-world"
  21 |     }}>{`Basic JavaScript-rendered Hello World`}</h1>

Add @babel/preset-react (https://git.io/JfeDR) to the 'presets' section of your Babel config to enable transformation.
If you want to leave it as-is, add @babel/plugin-syntax-jsx (https://git.io/vb4yA) to the 'plugins' section to enable parsing.


    🚨  Failure: Project Validation. Please review the messages above for information on how to troubleshoot and resolve this issue.
npm ERR! code 1
npm ERR! path C:\Users\Alan Lindsay\projects\learning\epic-react\react-fundamentals
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c workshop-setup -q

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ALANLI~1\AppData\Roaming\npm-cache\_logs\2021-01-13T07_25_18_917Z-debug.lognpm ERR! code 1
npm ERR! path C:\Users\Alan Lindsay\projects\learning\epic-react\react-fundamentals
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node setup

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\ALANLI~1\AppData\Roaming\npm-cache\_logs\2021-01-13T07_25_18_983Z-debug.log
@alindsay55661
Copy link
Author

I was able to solve this by moving the "babel" section of the package.json file to a separate babel.config.js file. But why?

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

1 participant