#invalid type: map when using SWC

1 messages · Page 1 of 1 (latest)

hard grotto
#

You're missing transform option in jsc:

{
  "$schema": "https://json.schemastore.org/swcrc",
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "dynamicImport": true,
      "decorators": true
    },
    "target": "es2022",
    "transform": {
      "legacyDecorator": true,
      "decoratorMetadata": true
    }
  },
  "module": {
    "type": "commonjs",
    "strict": true
  },
  "sourceMaps": true,
  "minify": true
}

Both legacyDecorator and decoratorMetadata are required.

visual pagoda
#

@hard grotto I'm getting this error only when setting the "paths" property

ionic ore
#

@visual pagoda me too

visual pagoda
ionic ore
visual pagoda
#

I don't tested the compiled version... but I replaced every custom path to a relative one, like: "../../file/script"

fluid jacinth
#

In my case the solution was to remove the paths from .swcrc, and remove some of the path aliases that didn't quite work for some reason. I removed aliases in this style:

  "@models": ["src/models/index"],

I don't even know if this should work, but we had a bunch of these aliases and they are actually rarely used in our code, so I just adjusted the code too. Now I have just:

      "@src/*": ["src/*"],
      "@test/*": ["test/*"]