Skip to content

Failed to compile when requare any parts #30

@fschenkun22

Description

@fschenkun22

I use command > npm install metro4-react
and then:
import {Button} from "metro4-react";

import React, { Component } from 'react'
import {Button} from "metro4-react";

export default class App extends Component {
    render() {
        return (
            <div>
              <Button>Button</Button>
            </div>
        )
    }
}

How can I solve the following problem

Failed to compile
./node_modules/metro4-react/src/components/tag-input/tag-input.js
SyntaxError: E:\WWW\gitSearch\git-search\node_modules\metro4-react\src\components\tag-input\tag-input.js: Support for the experimental syntax 'jsx' isn't currently enabled (142:13):

140 |
141 | return (

142 | <div className={tag-input ${focus ? 'focused' : ''} ${staticMode ? 'static-mode' : ''}} ref={this.component}>
| ^
143 | {tags.map( (tag, index) => {
144 | return (
145 | <Tag

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.
This error occurred during the build time and cannot be dismissed.Failed to compile
./node_modules/metro4-react/src/components/tag-input/tag-input.js
SyntaxError: E:\WWW\gitSearch\git-search\node_modules\metro4-react\src\components\tag-input\tag-input.js: Support for the experimental syntax 'jsx' isn't currently enabled (142:13):

140 |
141 | return (

142 | <div className={tag-input ${focus ? 'focused' : ''} ${staticMode ? 'static-mode' : ''}} ref={this.component}>
| ^
143 | {tags.map( (tag, index) => {
144 | return (
145 | <Tag

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.
This error occurred during the build time and cannot be dismissed.

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