Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seek help: throw error in compiling,I don't know what to do #653

Open
halo951 opened this issue Jul 1, 2020 · 1 comment
Open

seek help: throw error in compiling,I don't know what to do #653

halo951 opened this issue Jul 1, 2020 · 1 comment

Comments

@halo951
Copy link

halo951 commented Jul 1, 2020

Expected behavior:

I want to configure the include option

Actual behavior:

The following errors occur occasionally, and i execute save file,and recompile . this error is disappears.
In this case, I don't know how to configure include

Add: the error occurs only in files that use the import statement

src\mulit\cloud.ts(1,25): error TS6307: File 'D:/workspace/mp/zb-ugg/src/config.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.
src\mulit\cloud.ts(2,21): error TS6307: File 'D:/workspace/mp/zb-ugg/src/utils/api.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.
D:/workspace/mp/zb-ugg/src/utils/api.ts(1,34): error TS6307: File 'D:/workspace/mp/zb-ugg/src/utils/wechat-version-diff.ts' is not listed within the file list of project ''. Projects must list all files or use an 'include' pattern.

Your gulpfile:

ts({
   // import tsconfig.compilerOptions 
    "target": "es5",
    "module": "ESNext",
    "lib": ["ESNext", "ES2020"],
    "sourceMap": false,
    "composite": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    },
    "types": ["miniprogram-api-typings"],
    "tsBuildInfoFile": "./logs/ts.build.log",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "removeComments": true,
    "importHelpers": false,
    "strict": true,
    "strictNullChecks": false,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "allowUmdGlobalAccess": true,
    "forceConsistentCasingInFileNames": true

 });


tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "ESNext",
    "lib": ["ESNext", "ES2020"],
    "sourceMap": false,
    "composite": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    },
    "types": ["miniprogram-api-typings"],
    "tsBuildInfoFile": "./logs/ts.build.log",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "moduleResolution": "node",
    "removeComments": true,
    "importHelpers": false,
    "strict": true,
    "strictNullChecks": false,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "allowUmdGlobalAccess": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["./src/*", "./src/**/*", "./templates/**/*"],
  "exclude": ["./src/assets"]
}

Code

Include your TypeScript code, if necessary.

// example for api.ts

import { isVersionSupport } from "@/utils/wechat-version-diff";

export const api:Record<string,any> = {};

@halo951
Copy link
Author

halo951 commented Jul 1, 2020

英语不好,望见谅
English is not good. I'm sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant