Skip to content
New issue

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

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

Already on GitHub? # to your account

Exporting a function named html provokes a 404 (index.html.html) #2497

Closed
JulianCataldo opened this issue Feb 7, 2024 · 5 comments
Closed
Labels
bug Functionality does not match expectation no bug This is expected behavior

Comments

@JulianCataldo
Copy link

Hello,

It looks like doing this:

// NOTE: Just `export { html } from '@lit-labs/ssr';` will not show in TypeDoc.
import { html as litHtml } from '@lit-labs/ssr';
export const html = litHtml;

is producing this page : index.html.html.

That will trigger a 404 page.

Renaming to htmll, for example, solve the problem.

@JulianCataldo JulianCataldo added the bug Functionality does not match expectation label Feb 7, 2024
@JulianCataldo
Copy link
Author

JulianCataldo commented Feb 7, 2024

Just an additional note, when deploying to GH Pages, it does work.
It might be correlated with trailing slash behavior.

@Gerrit0 Gerrit0 added the needs reproduction Needs a minimal reproducible case - https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d label Feb 9, 2024
@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 9, 2024

I can't reproduce this. I copied your code into a new project, installed the latest TypeDoc version + @lit-labs/ssr, and ran TypeDoc on that file. The generated docs appear to work just fine, producing this:

~/Desktop/td_tests> tree docs
docs
├── assets
│   ├── highlight.css
│   ├── main.js
│   ├── navigation.js
│   ├── search.js
│   └── style.css
├── functions
│   └── html.html
├── index.html
└── modules.html

@JulianCataldo
Copy link
Author

JulianCataldo commented Feb 13, 2024

Hello. Indeed it's working in production, when it's served from an env which add a trailing slash (Vercel, GH Pages…).
In dev. it broke, I think, because of that and maybe another factor.
You're right, I'm gonna put up a minimal repro. and get back to you.
Thanks!

In the meanwhile, it's possible to just clone this and run the TypeDoc command:

git clone https://github.com/JulianCataldo/og-images-generator
cd og-images-generator
pnpm i -r

pnpm build:docs

It's even deployed on a GH Page: https://juliancataldo.github.io/og-images-generator/

So it should be straightforward to compare.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Feb 14, 2024

Looking at that, index.html.html is the expected filename, as the member is named html and is in a module named index. Links to it look like they work...

@Gerrit0 Gerrit0 added no bug This is expected behavior and removed needs reproduction Needs a minimal reproducible case - https://gist.github.com/Rich-Harris/88c5fc2ac6dc941b22e7996af05d labels Feb 18, 2024
@JulianCataldo
Copy link
Author

Oh, I've see I've overlooked an important fact: in local dev, I use npx serve docs.

Only with index.html.html, I've got the 404 + redirect to functions. Trailing slash has nothing to do with it, as I suspected at first.

Screenshot 2024-02-18 at 20 45 16

Maybe overly zealous Regex?

So, I conclude that this is a serve issue, not a Typedoc one!

Thank you. Closing

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Functionality does not match expectation no bug This is expected behavior
Projects
None yet
Development

No branches or pull requests

2 participants