可构建的库无法从不可构建的库导入或导出(eslint)

3gw*_*ain 4 nomachine-nx nx-workspace

当我从库之一导入接口时出现上述错误:

import { DetailsProps } from '@vite/prop-types'; //error
import styles from './header.module.less';

const initailDetails: DetailsProps = {
  name: 'Arif',
  city: 'Chennai',
  pin: 600019,
};
export function Header() {
  return (
    <div className={styles['container']}>
      <h1>Welcome to Header!</h1>
      <ul>
        {Object.values(initailDetails).map((v) => (
          <li key={v}>{v}</li>
        ))}
      </ul>
    </div>
  );
}
Run Code Online (Sandbox Code Playgroud)

NX报告:

  Node : 16.13.2
   OS   : darwin arm64
   npm  : 8.1.2
   
   nx : 15.3.3
   @nrwl/angular : Not Found
   @nrwl/cypress : 15.3.3
   @nrwl/detox : Not Found
   @nrwl/devkit : 15.3.3
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 15.3.3
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : Not Found
   @nrwl/js : 15.3.3
   @nrwl/linter : 15.3.3
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 15.3.3
   @nrwl/react-native : Not Found
   @nrwl/rollup : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : Not Found
   @nrwl/web : Not Found
   @nrwl/webpack : Not Found
   @nrwl/workspace : 15.3.3
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:
     @nrwl/vite: 15.3.3
Run Code Online (Sandbox Code Playgroud)

Fel*_*ski 6

我从可构建的库的 project.json 中删除了它(它不能是导入源自的库,也可以是导入所在的库):

"build": {
  "executor": "@nx/js:tsc",
  "outputs": ["{options.outputPath}"],
  "options": {
    "outputPath": "dist/libs/shared/dto",
    "main": "libs/shared/dto/src/index.ts",
    "tsConfig": "libs/shared/dto/tsconfig.lib.json",
    "assets": ["libs/shared/dto/*.md"]
  }
},
Run Code Online (Sandbox Code Playgroud)

然后使缓存无效,错误消失