swc-project / pkgs

node.js packages for SWC
59 stars 19 forks source link

[BUG Report] Expression expected #58

Closed Sunny-117 closed 1 month ago

Sunny-117 commented 1 month ago

image

swc-loader@0.2.6

Sunny-117 commented 1 month ago
{
    "$schema": "https://swc.rs/schema.json",
    "jsc": {
        "parser": {
            "syntax": "ecmascript",
            "jsx": false,
            "dynamicImport": false,
            "privateMethod": false,
            "functionBind": false,
            "exportDefaultFrom": false,
            "exportNamespaceFrom": false,
            "decorators": false,
            "decoratorsBeforeExport": false,
            "topLevelAwait": false,
            "importMeta": false
        },
        "transform": null,
        "target": "es5",
        "loose": false,
        "externalHelpers": false,
        // Requires v1.2.50 or upper and requires target to be es2016 or upper.
        "keepClassNames": false
    },
    "minify": false
}
Sunny-117 commented 1 month ago
Caused by:
    Syntax Error
 @ ./src/__ocpc__/entry/components.ts 18:0-84 23:0-366
 @ container entry

ERROR in ./src/__ocpc__/containers/ocpcPackageList/columns/ocpcBidType.js
Module build failed (from ../../node_modules/.pnpm/swc-loader@0.2.6_@swc+core@1.7.23+webpack@5.13.0/node_modules/swc-loader/src/index.js):
Error:   × Expression expected
    ╭─[/Users/olive/Des-center/src/__ocpc__/containers/ocpcPackageList/columns/ocpcBidType.js:20:1]
 17 │ export default {
 18 │     render: createCustomRender((configs, {trigger}) => {
 19 │         return withSumAndEmptyExpanedCell((value, record) => {
 20 │             const Node = <span>{bidTypeText[value] || '-'}</span>;
    ·                          ─
 21 │             return Node;
 22 │         });
 23 │     }),
    ╰────
  × Unexpected token `[`. Expected ... , *,  (, [, :, , ?, = or an identifier
    ╭─[/Users/olive/Desktop/bs/assets-center/src/__ocpc__/containers/ocpcPackageList/columns/ocpcBidType.js:20:1]
 17 │ export default {
 18 │     render: createCustomRender((configs, {trigger}) => {
 19 │         return withSumAndEmptyExpanedCell((value, record) => {
 20 │             const Node = <span>{bidTypeText[value] || '-'}</span>;
    ·                                            ─
 21 │             return Node;
 22 │         });
 23 │     }),
kdy1 commented 1 month ago

Please file an issue on https://github.com/swc-project/swc instead.