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
We use api-extractor to roll up .d.ts files to a single file, as well as for generating a document model JSON file.
api-extractor now generates a warning for every SFC that uses slots, e.g.
(ae-forgotten-export) The symbol "__VLS_WithTemplateSlots_31" needs to be exported by the entry point index.d.ts
I don't want to ignore this message, because a missing export in the rolled up .d.ts file will break builds, so we want the build process to error. But _VLS_WithTemplateSlots is a synthetic byproduct of vue-tsc, and not at all useful in the final .d.ts.
Is there a workaround, other than ignoring ae-forgotten-export messages?
The text was updated successfully, but these errors were encountered:
I actually do want the DefineComponent to be emitted, however, so that the imported values can be typed correctly when passed to my app.component calls in the module that imports this library. I find that really helpful, and it has worked great in the past until 1.0.10 when it went all pear shaped and forced me to @ts-expect-error like crazy.
But back to the issue, since __VLS_WithTemplateSlots is declared as a separate type 31 times in my component library dts files, api-extractor mangles the name in the rolled up dts file, and they are not exported. Manually slapping "export" in front of the type definition in the pre-rolledup files doesn't really help, because they're not re-exported at higher levels.
This isn't to say that I can't just ignore the exit code from api-extractor and continue by build anyway, because it doesn't prevent the dts files from being generated and working where needed, but with all the messaging spam it makes it hard to find actual issues. Maybe this is a failing of api-extractor and I should just forego rolling up the .d.ts files, but it's a great linting tool for preventing issues when generating documenattion with typedoc.
So if there was a way to disable this Volar-specific wrapper and just generate the actual DefineComponent type, I believe that would 100% fix the issue.