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
AssertionError [ERR_ASSERTION]: Missing parent symbol when converting function #1436
Comments
I hit the same problem about simultaneously. In my case, I tracked it down to the following module declaration: declare module 'present';
declare function present(): number; This was needed because of missing declarations for this: import present from 'present'; My workaround: exclude the file Alternate workaround: const present = require('present') as () => number; (and comment out the |
The error message is completely opaque. To track down what symbol was the cause, I changed the const showScope = s => JSON.stringify({id: s.id, name: s.name, originalName: s.originalName, kind: s.kind})
assert(parentSymbol, !parentSymbol && `Missing parent symbol when converting function ${symbol.escapedName} scope ${showScope(context.scope)} parent ${showScope(context.scope.parent)}`); The |
@BobKerns Thank you for the debugging tip (I was just too lazy to dig into the source and hoped for some feedback) I just added the code change and am getting the following error
without obvious reason (to me) in the following code function isStyleSupported(prop: string, value: string = 'inherit'): boolean {
const el = window.document.createElement('div');
const camelRe = /-([a-z]|[0-9])/ig;
// Try the native standard method first
if ('CSS' in window && 'supports' in window.CSS) {
return window.CSS.supports(prop, value);
}
// Check Opera's native method
if ('supportsCSS' in window) {
return (window as any).supportsCSS(prop, value); // eslint-disable-line @typescript-eslint/no-explicit-any
}
// Convert to camel-case for DOM interactions
const camel = prop.replace(camelRe, function (all, letter) {
return String(letter).toUpperCase();
});
// Check if the property is supported
const support = camel in el.style;
// Assign the property and value to invoke the CSS interpreter
el.style.cssText = prop + ':' + value;
// Ensure both the property and value are supported and return
return support && (el.style as any)[camel] !== ''; // eslint-disable-line @typescript-eslint/no-explicit-any
}
$(function () {
if (!isStyleSupported('display', 'flex')) {
$('body').addClass('no-flexbox');
}
if (!isStyleSupported('animation-name')) {
$('body').addClass('no-css-animation');
}
}); |
It's not obvious to me either. I didn't attempt to understand what was going wrong. Once I identified the function and context I proceeded by trial and error, removing stuff. That was pretty limited in my case; it may be more challenging here. If you want to try to debug it, ndb may be helpful. |
This is caused by the function being present in a non-module file, the assertion that we have a parent isn't appropriate there - it should only be asserted if the function being converted is a method. Fixed in 0.20.5 |
Search terms
ERR_ASSERTION
Expected Behavior
No exception in TypeDoc 0.20.2 but error in TypeDoc 0.20.3 and TypeDoc 0.20.4
Actual Behavior
Steps to reproduce the bug
typedoc.json
Environment
The text was updated successfully, but these errors were encountered: