Vue js - You may need an additional loader to handle the result of these loaders

Viewed 645

so i have this issue : This is my tsconfig:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "skipLibCheck": true,
    "esModuleInterop": true,
    "noImplicitAny": false,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": [
      "webpack-env"
    ],
    "paths": {
      "@/*": [
        "src/*"
      ]
    },
    "lib": [
      "esnext",
      "dom",
      "dom.iterable",
      "scripthost"
    ]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": [
    "node_modules"
  ]
}

This is my code issue: 1 - File was processed with these loaders:

Module parse failed: Unexpected token (104:32)
File was processed with these loaders:
 * ./node_modules/cache-loader/dist/cjs.js
 * ./node_modules/ts-loader/index.js
 * ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
|             if (this.documents.length > 0) {
|                 this.documents.forEach((element) => {
>                     if (element?.children?.length > 0) {
|                         flattDocs.push(...element.children);
|                         delete element.children;

2 - File was processed with these loaders:

Module parse failed: Unexpected token (111:31)
File was processed with these loaders:
 * ./node_modules/cache-loader/dist/cjs.js
 * ./node_modules/ts-loader/index.js
 * ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
|     created() {
|         debugger;
>         if (this.$route.params?.id)
|             this.getAllProjectDocuments(this.$route.params.id);
|         else {

3 - File was processed with these loaders:

File was processed with these loaders:
 * ./node_modules/cache-loader/dist/cjs.js
 * ./node_modules/ts-loader/index.js
 * ./node_modules/cache-loader/dist/cjs.js
 * ./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js
You may need an additional loader to handle the result of these loaders.
|         ...mapGetters(["currentUser"]),
|         userNameInitials() {
>             const userName = this.currentUser?.name;
|             let name = "";
|             if (userName) {

4 - File was processed with these loaders:

Module parse failed: Unexpected token (97:21)
File was processed with these loaders:
 * ./node_modules/cache-loader/dist/cjs.js
 * ./node_modules/ts-loader/index.js
 * ./node_modules/eslint-loader/index.js
You may need an additional loader to handle the result of these loaders.
|             if (!e.objectIds)
|                 e.objectIds = [];
>             if (meta?.id)
|                 e.objectIds.push(meta.id);
|             e.objectId = meta ? meta.id : null;

I was trying to play with tsconfig but it didn't help. I saw some article on stackover flow, and the issue is that the code can't compile. and i should add something to tsconfig file, but i have no idea what.

0 Answers
Related