Skip to content
This repository was archived by the owner on Apr 1, 2023. It is now read-only.
This repository was archived by the owner on Apr 1, 2023. It is now read-only.

Support for the experimental syntax 'jsx' isn't currently enabled #363

@Ploppz

Description

@Ploppz

I made a library with create-react-library called components.

What's weird is that it builds just fine (npm build) but when I try to use it in an application I get the error

ERROR in ../components/src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /home/ploppz/components/src/index.js: Support for the experimental syntax 'jsx' isn't currently enabled (18:10):

  16 |
  17 | function MyAppBar({ children, name }) {
> 18 |   return <AppBar title={<span>Title</span>} position={"sticky"}>
     |          ^
  19 |     <Toolbar>
  20 |       <a href="/">
  21 |         <img

In package.json: "components": "file:../components",

This application is a CRA application that worked fine before I tried to include this library - it definitely has JSX enabled.
When I google my problem, the solutions I find have to change the babel config, but afaik, I cannot do that without ejecting the CRA...

Please tell me if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions