Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

SyntaxError: Invalid regular expression flag

Đang mở
#329 1 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, react
Lĩnh vực
documentation, tooling

Hướng nghiên cứu

Bắt đầu với Card/Card.jsx và styleguide.config.js, sau đó chạy phần phân tích react-docgen được báo cáo thông qua thiết lập react-styleguidist. Tái hiện lỗi cờ biểu thức chính quy không hợp lệ và truy vết cấu trúc cú pháp nào gây ra lỗi; được xem là hoàn thành khi ví dụ được phân tích thành công hoặc cú pháp không được hỗ trợ được xác định rõ ràng và được bao phủ bằng một bài kiểm thử phù hợp.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I use
create-react-app with "react-scripts": "^2.1.5"
and "react-styleguidist": "^8.0.6"

Warning: Cannot parse src/components/Card/Card.jsx: SyntaxError: Invalid regular expression flag (1:8)

It usually means that react-docgen does not understand your source code, try to file an issue here:
https://github.com/reactjs/react-docgen/issues
import React from "react";
// nodejs library that concatenates classes
import classNames from "classnames";
// nodejs library to set properties for components
import PropTypes from "prop-types";
// @material-ui/core components
import withStyles from "@material-ui/core/styles/withStyles";
// @material-ui/icons

// core components
import cardStyle from "./cardStyle.jsx";

function Card({ ...props }) {
	const { classes, className, children, plain, carousel, ...rest } = props;
	const cardClasses = classNames({
		[classes.card]: true,
		[classes.cardPlain]: plain,
		[classes.cardCarousel]: carousel,
		[className]: className !== undefined
	});
	return (
		<div className={cardClasses} {...rest}>
			{children}
		</div>
	);
}

Card.propTypes = {
	classes: PropTypes.object.isRequired,
	className: PropTypes.string,
	plain: PropTypes.bool,
	carousel: PropTypes.bool,
	children: PropTypes.object.isRequired
};

export default withStyles(cardStyle)(Card);

and "react-styleguidist": "^8.0.6"
styleguide.config.js

module.exports = {
	propsParser: require("react-docgen").parse,
	webpackConfig: require("react-scripts/config/webpack.config"),
};
Ngôn ngữ chính
TypeScript
Star
3.8k
Fork
316
Merge trung bình
3 giờ 28 phút
Pull request đã merge (30 ngày)
6

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của reactjs/react-docgen

Tất cả issue của reactjs/react-docgen

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.