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

Unable to locate entry point #2082

Closed
blessanm86 opened this issue Oct 23, 2022 · 6 comments
Closed

Unable to locate entry point #2082

blessanm86 opened this issue Oct 23, 2022 · 6 comments
Labels
bug Functionality does not match expectation

Comments

@blessanm86
Copy link

blessanm86 commented Oct 23, 2022

I tried typedoc along with the docusaurus plugin and I get an error Unable to locate entry point

warning You are running with an unsupported TypeScript version! This may work, or it might break. TypeDoc supports 4.6, 4.7, 4.8
warning Unable to locate entry point: /Users/bmathew/Desktop/repos/nx-web/libs/components/src/index.ts
error Unable to find any entry points. Make sure TypeDoc can find your tsconfig

This file exists. I even tried a test shell command to see if this file exists and its not some typo.
Interesting thing is I have other libs and it works totally fine for them.

Expected Behavior

Should just work.

Actual Behavior

Steps to reproduce the bug

I am using

"docusaurus-plugin-typedoc": "^0.17.5",
"typedoc": "^0.23.16",
"typedoc-plugin-markdown": "^3.13.6",
"typescript": "~4.4.3",

And this is how I use it in docusarus

plugins: [
    [
      'docusaurus-plugin-typedoc',
      {
        id: 'product-analytics',
        out: 'libs/product-analytics',
        entryPoints: ['../../libs/utils/product-analytics/src/index.ts'],
        tsconfig: '../../libs/utils/product-analytics/tsconfig.json',
        sidebar: {
          categoryLabel: '@web/product-analytics',
          position: 100,
          indexLabel: 'API',
        },
        cleanOutputDir: true,
      },
    ],
    [
      'docusaurus-plugin-typedoc',
      {
        id: 'components',
        out: 'libs/components',
        entryPoints: ['../../libs/components/src/index.ts'],
        tsconfig: '../../libs/components/tsconfig.json',
        sidebar: {
          categoryLabel: '@web/components',
          position: 100,
          indexLabel: 'API',
        },
        cleanOutputDir: true,
      },
    ],
    require.resolve('@cmfcmf/docusaurus-search-local'),
  ],
@blessanm86 blessanm86 added the bug Functionality does not match expectation label Oct 23, 2022
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 23, 2022

If you run typedoc outside of docusaurus with those options, does it work? I don't support that plugin, so unless it's also broken outside of that, you'll have to open an issue with that repo.

@Gerrit0 Gerrit0 added the needs reproduction Needs a minimal reproducible case label Oct 23, 2022
@blessanm86
Copy link
Author

I tested with just typedoc and still have the issue.

bmathew@Blessans-MacBook-Pro-4 components % ls -1     
README.md
jest.config.js
project.json
src
tsconfig.json
tsconfig.lib.json
tsconfig.spec.json

bmathew@Blessans-MacBook-Pro-4 components % cd src 
bmathew@Blessans-MacBook-Pro-4 src % ls -1
Sandbox
Translate
UntrustedLink
index.ts
bmathew@Blessans-MacBook-Pro-4 src % cd ../

bmathew@Blessans-MacBook-Pro-4 components % typedoc src/index.ts 
Loaded plugin /Users/bmathew/Desktop/repos/personio-web/node_modules/typedoc-plugin-markdown
warning You are running with an unsupported TypeScript version! This may work, or it might break. TypeDoc supports 4.6, 4.7, 4.8
warning Unable to locate entry point: /Users/bmathew/Desktop/repos/personio-web/libs/components/src/index.ts
error Unable to find any entry points. Make sure TypeDoc can find your tsconfig

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 23, 2022

tsconfig.json
tsconfig.lib.json

Please share these files

@blessanm86
Copy link
Author

tsconfig.json

{
  "extends": "../../tsconfig.base.json",
  "compilerOptions": {
    "jsx": "react-jsx",
    "allowJs": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": false,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true
  },
  "files": [
    "../../node_modules/@nrwl/react/typings/styled-jsx.d.ts",
    "../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
    "../../node_modules/@nrwl/react/typings/image.d.ts"
  ],
  "include": [],
  "references": [
    {
      "path": "./tsconfig.lib.json"
    },
    {
      "path": "./tsconfig.spec.json"
    }
  ]
}

tsconfig.lib.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "../../dist/out-tsc",
    "types": ["node"]
  },
  "files": [
    "../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
    "../../node_modules/@nrwl/next/typings/image.d.ts"
  ],
  "exclude": [
    "**/*.spec.ts",
    "**/*.test.ts",
    "**/*.spec.tsx",
    "**/*.test.tsx",
    "**/*.spec.js",
    "**/*.test.js",
    "**/*.spec.jsx",
    "**/*.test.jsx"
  ],
  "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx"]
}

tsconfig.base.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "rootDir": ".",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "ES2020",
    "module": "esnext",
    "lib": ["ES2020", "dom", "DOM.Iterable"],
    "skipLibCheck": true,
    "skipDefaultLibCheck": true,
    "suppressImplicitAnyIndexErrors": true,
    "resolveJsonModule": true,
    "baseUrl": ".",
    "paths": {
      "@personio-web/components": ["libs/components/src/index.ts"]
    }
  },
  "exclude": ["node_modules", "tmp"]
}

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Oct 23, 2022

Your base tsconfig that you've told TypeDoc to read specifies:

  "files": [
    "../../node_modules/@nrwl/react/typings/styled-jsx.d.ts",
    "../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
    "../../node_modules/@nrwl/react/typings/image.d.ts"
  ],
  "include": [],

The ts.Program created by this does not include src/index.ts, so as far as TypeDoc is concerned, it doesn't exist. If you specify tsconfig.lib.json as the tsconfig to use, everything should work as expected.

TypeDoc has logic to try to detect if a tsconfig.json file is meant to be a "solution" tsconfig, and if so, also read the referenced tsconfig files, but this only applies if the tsconfig file references no other files, so "files": [ ... ] prevents that detection from happening.

@Gerrit0 Gerrit0 removed the needs reproduction Needs a minimal reproducible case label Oct 23, 2022
@blessanm86
Copy link
Author

I see. Thank u very much for the explanation. I'm still getting familiar with all the tsconfig options.
Things are working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality does not match expectation
Projects
None yet
Development

No branches or pull requests

2 participants