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

existsSync is not exported

Đang mở
#27 2 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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với cấu hình nodePolyfills() và đường dẫn polyfills/empty.js được nêu trong lỗi, sau đó kiểm tra import existsSync từ ../../core/utils/silly-i18n/src/index.js. Hoàn tất có nghĩa là xác định hoặc ghi lại tùy chọn cung cấp shim được browserify và xác nhận rằng bản build Rollup không còn báo existsSync là bị thiếu.

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

Mô tả

With this configuration:

import copy from "rollup-plugin-copy";
import sucrase from "@rollup/plugin-sucrase";
import json from "@rollup/plugin-json";
import css from "rollup-plugin-css-only";
import resolve from "@rollup/plugin-node-resolve";
import svg from "rollup-plugin-svg";
import nodePolyfills from 'rollup-plugin-node-polyfills';

export default {
    input: "src/index.jsx",
    output: {
        file: "dist/index.js",
        format: "iife",
        globals: {
            react: "React",
            fs: "fs",
            path: "path",
            "react-dom": "ReactDOM",
        },
    },
    //This is meant to suppress the warning for d3-selection circular dependencies (https://github.com/d3/d3-selection/issues/168)
    onwarn: function (warning, warn) {
        if (warning.code === "CIRCULAR_DEPENDENCY") return;
        warn(warning);
    },
    plugins: [
        svg(),
        css({ output: "css/bundle.css" }),
        json(),
        nodePolyfills(),
        sucrase({
            transforms: ["jsx"],
            production: true,
        }),
        copy({
            targets: [
                {
                    src: [
                        "node_modules/react/umd/react.development.js",
                        "node_modules/react-dom/umd/react-dom.development.js",
                        "src/static/*",
                    ],
                    dest: "dist",
                },
            ],
            verbose: true,
        }),
        resolve(),
    ],
    external: ["react", "react-dom"],
};

I get this error

[!] Error: 'existsSync' is not exported by node_modules/rollup-plugin-node-polyfills/polyfills/empty.js, imported by ../../core/utils/silly-i18n/src/index.js

It's true that the documentation mentions

optional, add option to enable browserified shim

However, not clear how to add that option. What does it really mean?

Ngôn ngữ chính
JavaScript
Star
142
Fork
64
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 ionic-team/rollup-plugin-node-polyfills

Tất cả issue của ionic-team/rollup-plugin-node-polyfills

Issue tương tự

Thêm issue về JavaScript

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.