You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected to be able to define my project entry point as a .js file. I am using TS-style docstrings to document JS sources.
Actual Behavior
It complains the .js file must have a sourceMappingUrl and exits with a non-zero error code
Steps to reproduce the bug
Create a .js file. module.exports = true or smth
Use it as an entry point
Environment
Typedoc version: TypeDoc 0.23.10
TypeScript version: Using TypeScript 4.7.4 from ./node_modules/typescript/lib
Node.js version: v18.4.0
OS: macOS
I realize why this happens: TypeDoc expects a .js entry point to be a file compiled by tsc; that's the most common use-case.
To work around this, I use a Babel-compiled .js entry point. That entry point references an external source map which references the original source .js file. TypeDoc seemingly has no problems otherwise generating docs from my JS sources.
I note that inline source maps are apparently not supported; an inline source map causes TypeDoc to attempts to open a file using the source map as a filepath, which throws ENAMETOOLONG 😄
I have no idea what the practical impact would be of just allowing a .js source file as the entry point other than making TypeDoc easier to use for those ornery "types-in-JS" people like myself.
The text was updated successfully, but these errors were encountered:
I note that inline source maps are apparently not supported;
Just took a look at the code, and they appear to be supported, do you have an example you could toss my way (in a new issue)? Looks like you could break it if the source map URL doesn't start with data:application/json;base64 and is inline, but the maps generated by tsc at least seem to match this.
Search terms
javascript sourcemap source map
Expected Behavior
I expected to be able to define my project entry point as a
.js
file. I am using TS-style docstrings to document JS sources.Actual Behavior
It complains the
.js
file must have asourceMappingUrl
and exits with a non-zero error codeSteps to reproduce the bug
.js
file.module.exports = true
or smthEnvironment
I realize why this happens: TypeDoc expects a
.js
entry point to be a file compiled bytsc
; that's the most common use-case.To work around this, I use a Babel-compiled
.js
entry point. That entry point references an external source map which references the original source.js
file. TypeDoc seemingly has no problems otherwise generating docs from my JS sources.I note that inline source maps are apparently not supported; an inline source map causes TypeDoc to attempts to open a file using the source map as a filepath, which throws
ENAMETOOLONG
😄I have no idea what the practical impact would be of just allowing a
.js
source file as the entry point other than making TypeDoc easier to use for those ornery "types-in-JS" people like myself.The text was updated successfully, but these errors were encountered: