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

Spec rendering failed: TypeError: t is null #193

Closed
seanpk opened this issue Feb 1, 2017 · 11 comments
Closed

Spec rendering failed: TypeError: t is null #193

seanpk opened this issue Feb 1, 2017 · 11 comments

Comments

@seanpk
Copy link

seanpk commented Feb 1, 2017

Here is the top of the exception trace:

TypeError: t is null
t.exports@https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js:25:29776
a</t.prototype.headingOpenRule@https://rebilly.github.io/ReDoc/releases/latest/redoc.min.js:23:13881

Unfortunately I can't share this spec and scrubbing it is an unreasonable effort.
Is there an easy way to grab a non-minified version to get a better stacktrace?

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Feb 1, 2017

Just built and attached unminified version with source map: Archive.zip

@jsmartfo
Copy link
Contributor

jsmartfo commented Feb 1, 2017

Related to #179? I believe the PR should resolve.

H2 before H1 md in the description section of swagger doc

@RomanHotsiy
Copy link
Member

@jsmartfo thanks!
@seanpk can you check if you have H2 before H1 in the info.description of your spec?

@seanpk
Copy link
Author

seanpk commented Feb 1, 2017

thanks @RomanGotsiy - using that Archive I get this stacktrace:

	ErrorHandler</ErrorHandler.prototype.handleError http://localhost:10080/Archive/redoc.min.js:25751:13
	CustomErrorHandler</CustomErrorHandler.prototype.handleError http://localhost:10080/Archive/redoc.min.js:42303:9
	PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone/</<.next http://localhost:10080/Archive/redoc.min.js:17959:65
	EventEmitter</EventEmitter.prototype.subscribe/schedulerFn< http://localhost:10080/Archive/redoc.min.js:25933:36
	SafeSubscriber</SafeSubscriber.prototype.__tryOrUnsub http://localhost:10080/Archive/redoc.min.js:652:13
	SafeSubscriber</SafeSubscriber.prototype.next http://localhost:10080/Archive/redoc.min.js:601:17
	Subscriber</Subscriber.prototype._next http://localhost:10080/Archive/redoc.min.js:554:9
	Subscriber</Subscriber.prototype.next http://localhost:10080/Archive/redoc.min.js:518:13
	Subject</Subject.prototype.next http://localhost:10080/Archive/redoc.min.js:3667:17
	EventEmitter</EventEmitter.prototype.emit http://localhost:10080/Archive/redoc.min.js:25919:54
	NgZone</NgZone.prototype.triggerError http://localhost:10080/Archive/redoc.min.js:12402:56
	NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onHandleError http://localhost:10080/Archive/redoc.min.js:12363:17
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.handleError http://localhost:10080/Archive/redoc.min.js:100336:17
	Zone$1</Zone</Zone.prototype.runGuarded http://localhost:10080/Archive/redoc.min.js:100219:25
	drainMicroTaskQueue/_loop_1 http://localhost:10080/Archive/redoc.min.js:100534:25
	drainMicroTaskQueue http://localhost:10080/Archive/redoc.min.js:100543:21
	ZoneTask/this.invoke http://localhost:10080/Archive/redoc.min.js:100439:25
	(Async: EventListener.handleEvent)
	defaultListenerMetaCreator/<.invokeAddFunc http://localhost:10080/Archive/redoc.min.js:101244:24
	scheduleEventListener http://localhost:10080/Archive/redoc.min.js:101271:16
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.scheduleTask http://localhost:10080/Archive/redoc.min.js:100345:21
	Zone$1</Zone</Zone.prototype.scheduleEventTask http://localhost:10080/Archive/redoc.min.js:100261:20
	zoneAwareAddListener http://localhost:10080/Archive/redoc.min.js:101316:9
	addEventListener http://localhost:10080/Archive/redoc.min.js%20line%20101422%20%3E%20Function:1:43
	patchProperty/desc.set http://localhost:10080/Archive/redoc.min.js:101134:13
	ClientRequest.prototype._onFinish http://localhost:10080/Archive/redoc.min.js:98791:3
	module.exports/< http://localhost:10080/Archive/redoc.min.js:98672:3
	EventEmitter.prototype.emit http://localhost:10080/Archive/redoc.min.js:21254:9
	finishMaybe http://localhost:10080/Archive/redoc.min.js:31892:7
	endWritable http://localhost:10080/Archive/redoc.min.js:31902:3
	Writable.prototype.end http://localhost:10080/Archive/redoc.min.js:31872:41
	ClientRequest.prototype.end http://localhost:10080/Archive/redoc.min.js:98873:2
	get http://localhost:10080/Archive/redoc.min.js:49619:2
	get/< http://localhost:10080/Archive/redoc.min.js:72829:15
	ZoneAwarePromise http://localhost:10080/Archive/redoc.min.js:100641:29
	get http://localhost:10080/Archive/redoc.min.js:72825:10
	download/< http://localhost:10080/Archive/redoc.min.js:72786:5
	ZoneAwarePromise http://localhost:10080/Archive/redoc.min.js:100641:29
	download http://localhost:10080/Archive/redoc.min.js:72781:10
	readHttp http://localhost:10080/Archive/redoc.min.js:72766:12
	getResult http://localhost:10080/Archive/redoc.min.js:73008:12
	runNextPlugin http://localhost:10080/Archive/redoc.min.js:72951:22
	exports.run/< http://localhost:10080/Archive/redoc.min.js:72940:5
	ZoneAwarePromise http://localhost:10080/Archive/redoc.min.js:100641:29
	exports.run http://localhost:10080/Archive/redoc.min.js:72939:10
	readFile/< http://localhost:10080/Archive/redoc.min.js:43645:5
	ZoneAwarePromise http://localhost:10080/Archive/redoc.min.js:100641:29
	readFile http://localhost:10080/Archive/redoc.min.js:43636:10
	parse http://localhost:10080/Archive/redoc.min.js:43608:12
	$RefParser.prototype.parse http://localhost:10080/Archive/redoc.min.js:71692:15
	$RefParser.prototype.resolve http://localhost:10080/Archive/redoc.min.js:71745:10
	$RefParser.prototype.bundle http://localhost:10080/Archive/redoc.min.js:71787:10
	SpecManager</SpecManager.prototype.load/promise< http://localhost:10080/Archive/redoc.min.js:3403:13
	ZoneAwarePromise http://localhost:10080/Archive/redoc.min.js:100641:29
	SpecManager</SpecManager.prototype.load http://localhost:10080/Archive/redoc.min.js:3401:23
	Redoc_1</Redoc.prototype.load http://localhost:10080/Archive/redoc.min.js:41671:9
	Redoc_1</Redoc.prototype.ngOnInit http://localhost:10080/Archive/redoc.min.js:41711:9
	Wrapper_Redoc</Wrapper_Redoc.prototype.ngDoCheck http://localhost:10080/Archive/redoc.min.js:61991:17
	View_Redoc_Host0</View_Redoc_Host0.prototype.detectChangesInternal http://localhost:10080/Archive/redoc.min.js:62039:9
	AppView</AppView.prototype.detectChanges http://localhost:10080/Archive/redoc.min.js:3114:9
	ViewRef_</ViewRef_.prototype.detectChanges http://localhost:10080/Archive/redoc.min.js:37540:9
	ApplicationRef_</ApplicationRef_.prototype.tick/< http://localhost:10080/Archive/redoc.min.js:18244:58
	ApplicationRef_</ApplicationRef_.prototype.tick http://localhost:10080/Archive/redoc.min.js:18244:13
	ApplicationRef_</ApplicationRef_.prototype._loadComponent http://localhost:10080/Archive/redoc.min.js:18219:9
	ApplicationRef_</ApplicationRef_.prototype.bootstrap http://localhost:10080/Archive/redoc.min.js:18207:9
	PlatformRef_</PlatformRef_.prototype._moduleDoBootstrap/< http://localhost:10080/Archive/redoc.min.js:18011:82
	PlatformRef_</PlatformRef_.prototype._moduleDoBootstrap http://localhost:10080/Archive/redoc.min.js:18011:13
	PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone/</</< http://localhost:10080/Archive/redoc.min.js:17963:21
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:10080/Archive/redoc.min.js:100332:17
	NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvoke http://localhost:10080/Archive/redoc.min.js:12342:28
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:10080/Archive/redoc.min.js:100331:17
	Zone$1</Zone</Zone.prototype.run http://localhost:10080/Archive/redoc.min.js:100203:24
	scheduleResolveOrReject/< http://localhost:10080/Archive/redoc.min.js:100625:52
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask http://localhost:10080/Archive/redoc.min.js:100365:21
	NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask http://localhost:10080/Archive/redoc.min.js:12333:28
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask http://localhost:10080/Archive/redoc.min.js:100364:21
	Zone$1</Zone</Zone.prototype.runTask http://localhost:10080/Archive/redoc.min.js:100241:28
	drainMicroTaskQueue http://localhost:10080/Archive/redoc.min.js:100523:25
	(Async: promise callback)
	scheduleQueueDrain http://localhost:10080/Archive/redoc.min.js:100496:17
	scheduleMicroTask http://localhost:10080/Archive/redoc.min.js:100504:9
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.scheduleTask http://localhost:10080/Archive/redoc.min.js:100348:21
	Zone$1</Zone</Zone.prototype.scheduleMicroTask http://localhost:10080/Archive/redoc.min.js:100255:20
	scheduleResolveOrReject http://localhost:10080/Archive/redoc.min.js:100623:9
	Zone$1</ZoneAwarePromise</ZoneAwarePromise.prototype.then http://localhost:10080/Archive/redoc.min.js:100712:17
	ApplicationInitStatus http://localhost:10080/Archive/redoc.min.js:17524:29
	AppModuleInjector</AppModuleInjector.prototype.createInternal http://localhost:10080/Archive/redoc.min.js:59316:41
	NgModuleInjector</NgModuleInjector.prototype.create http://localhost:10080/Archive/redoc.min.js:26140:71
	NgModuleFactory</NgModuleFactory.prototype.create http://localhost:10080/Archive/redoc.min.js:26108:9
	PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone/< http://localhost:10080/Archive/redoc.min.js:17953:47
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:10080/Archive/redoc.min.js:100332:17
	NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvoke http://localhost:10080/Archive/redoc.min.js:12342:28
	Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke http://localhost:10080/Archive/redoc.min.js:100331:17
	Zone$1</Zone</Zone.prototype.run http://localhost:10080/Archive/redoc.min.js:100203:24
	NgZone</NgZone.prototype.run http://localhost:10080/Archive/redoc.min.js:12211:51
	PlatformRef_</PlatformRef_.prototype._bootstrapModuleFactoryWithZone http://localhost:10080/Archive/redoc.min.js:17951:16
	PlatformRef_</PlatformRef_.prototype.bootstrapModuleFactory http://localhost:10080/Archive/redoc.min.js:17934:16
	bootstrapRedoc http://localhost:10080/Archive/redoc.min.js:66200:12
	init http://localhost:10080/Archive/redoc.min.js:50002:12
	autoInit http://localhost:10080/Archive/redoc.min.js:50023:9
	<anonymous> http://localhost:10080/Archive/redoc.min.js:50027:1
	__webpack_require__ http://localhost:10080/Archive/redoc.min.js:36:12
	<anonymous> http://localhost:10080/Archive/redoc.min.js:101987:18
	__webpack_require__ http://localhost:10080/Archive/redoc.min.js:36:12
	<anonymous> http://localhost:10080/Archive/redoc.min.js:82:18
	<anonymous> http://localhost:10080/Archive/redoc.min.js:17:18
	webpackUniversalModuleDefinition http://localhost:10080/Archive/redoc.min.js:15:19
	<anonymous> http://localhost:10080/Archive/redoc.min.js:7:11

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Feb 1, 2017

@seanpk and what is an error message?

@seanpk
Copy link
Author

seanpk commented Feb 1, 2017

displayed error message:

Oops... ReDoc failed to render this spec
string is null

the info.description starts with this:

    Integrate with FooBar using this RESTful API.

    <!-- NOTE: the titles of these sections are anchors in the document for reference, e.g.: #general-notes -->
    # General Notes
    ...

So, not an h2 before an h1 but a p and a comment.

... and, what that comment is trying to say is that those heading get used from within property descriptions to link to general concepts.

An example of that is the AtId definition:

properties:
  '@id':
    type: string
    format: path
    readOnly: true
    description: |
      The path, on this server, to the full definition of this resource.
      
      See [At ID](/docs/api/v2/#at-id) for more details.

where /docs/api/v2/ is the path that the SwaggerUI rendering of the spec is published.

console exception:

EXCEPTION: Uncaught (in promise): TypeError: string is null
replace@http://localhost:10080/Archive/redoc.min.js:49546:5
MdRenderer</MdRenderer.prototype.headingOpenRule@http://localhost:10080/Archive/redoc.min.js:42396:35
Renderer.prototype.render@http://localhost:10080/Archive/redoc.min.js:81241:17
Remarkable.prototype.render@http://localhost:10080/Archive/redoc.min.js:80725:10
MdRenderer</MdRenderer.prototype.renderMd@http://localhost:10080/Archive/redoc.min.js:42420:19
SpecManager</SpecManager.prototype.preprocess@http://localhost:10080/Archive/redoc.min.js:3452:57
SpecManager</SpecManager.prototype.init@http://localhost:10080/Archive/redoc.min.js:3442:9
SpecManager</SpecManager.prototype.load/promise</<@http://localhost:10080/Archive/redoc.min.js:3410:21
Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:10080/Archive/redoc.min.js:100332:17
NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvoke@http://localhost:10080/Archive/redoc.min.js:12342:28
Zone$1</ZoneDelegate</ZoneDelegate.prototype.invoke@http://localhost:10080/Archive/redoc.min.js:100331:17
Zone$1</Zone</Zone.prototype.run@http://localhost:10080/Archive/redoc.min.js:100203:24
scheduleResolveOrReject/<@http://localhost:10080/Archive/redoc.min.js:100625:52
Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:10080/Archive/redoc.min.js:100365:21
NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask@http://localhost:10080/Archive/redoc.min.js:12333:28
Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:10080/Archive/redoc.min.js:100364:21
Zone$1</Zone</Zone.prototype.runTask@http://localhost:10080/Archive/redoc.min.js:100241:28
drainMicroTaskQueue@http://localhost:10080/Archive/redoc.min.js:100523:25
promise callback*scheduleQueueDrain@http://localhost:10080/Archive/redoc.min.js:100496:17
scheduleMicroTask@http://localhost:10080/Archive/redoc.min.js:100504:9
Zone$1</ZoneDelegate</ZoneDelegate.prototype.scheduleTask@http://localhost:10080/Archive/redoc.min.js:100348:21
Zone$1</Zone</Zone.prototype.scheduleMicroTask@http://localhost:10080/Archive/redoc.min.js:100255:20
scheduleResolveOrReject@http://localhost:10080/Archive/redoc.min.js:100623:9
resolvePromise@http://localhost:10080/Archive/redoc.min.js:100586:21
makeResolver/<@http://localhost:10080/Archive/redoc.min.js:100567:13
get/</</<@http://localhost:10080/Archive/redoc.min.js:72858:9
EventEmitter.prototype.emit@http://localhost:10080/Archive/redoc.min.js:21272:7
endReadableNT@http://localhost:10080/Archive/redoc.min.js:44807:5
afterTickTwo@http://localhost:10080/Archive/redoc.min.js:31167:7
Item.prototype.run@http://localhost:10080/Archive/redoc.min.js:8278:5
drainQueue@http://localhost:10080/Archive/redoc.min.js:8248:17
setTimeout handler*runTimeout@http://localhost:10080/Archive/redoc.min.js:8175:16
process.nextTick@http://localhost:10080/Archive/redoc.min.js:8268:9
nextTick@http://localhost:10080/Archive/redoc.min.js:31166:12
resume@http://localhost:10080/Archive/redoc.min.js:44590:5
Readable.prototype.resume@http://localhost:10080/Archive/redoc.min.js:44582:5
Readable.prototype.on@http://localhost:10080/Archive/redoc.min.js:44552:48
get/</<@http://localhost:10080/Archive/redoc.min.js:72851:7
g@http://localhost:10080/Archive/redoc.min.js:21341:7
EventEmitter.prototype.emit@http://localhost:10080/Archive/redoc.min.js:21257:9
ClientRequest.prototype._connect@http://localhost:10080/Archive/redoc.min.js:98845:2
ClientRequest.prototype._onXHRProgress@http://localhost:10080/Archive/redoc.min.js:98829:3
ClientRequest.prototype._onFinish/xhr.onreadystatechange@http://localhost:10080/Archive/redoc.min.js:98779:6
patchProperty/desc.set/wrapFn@http://localhost:10080/Archive/redoc.min.js:101129:26
Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:10080/Archive/redoc.min.js:100365:21
NgZone</NgZone.prototype.forkInnerZoneWithAngularBehavior/this.inner<.onInvokeTask@http://localhost:10080/Archive/redoc.min.js:12333:28
Zone$1</ZoneDelegate</ZoneDelegate.prototype.invokeTask@http://localhost:10080/Archive/redoc.min.js:100364:21
Zone$1</Zone</Zone.prototype.runTask@http://localhost:10080/Archive/redoc.min.js:100241:28
ZoneTask/this.invoke@http://localhost:10080/Archive/redoc.min.js:100435:28
EventListener.handleEvent*defaultListenerMetaCreator/<.invokeAddFunc@http://localhost:10080/Archive/redoc.min.js:101244:24
scheduleEventListener@http://localhost:10080/Archive/redoc.min.js:101271:16
Zone$1</ZoneDelegate</ZoneDelegate.prototype.scheduleTask@http://localhost:10080/Archive/redoc.min.js:100345:21
Zone$1</Zone</Zone.prototype.scheduleEventTask@http://localhost:10080/Archive/redoc.min.js:100261:20
zoneAwareAddListener@http://localhost:10080/Archive/redoc.min.js:101316:9
addEventListener@http://localhost:10080/Archive/redoc.min.js line 101422 > Function:1:43
patchProperty/desc.set@http://localhost:10080/Archive/redoc.min.js:101134:13
ClientRequest.prototype._onFinish@http://localhost:10080/Archive/redoc.min.js:98775:3
module.exports/<@http://localhost:10080/Archive/redoc.min.js:98672:3
EventEmitter.prototype.emit@http://localhost:10080/Archive/redoc.min.js:21254:9
finishMaybe@http://localhost:10080/Archive/redoc.min.js:31892:7
endWritable@http://localhost:10080/Archive/redoc.min.js:31902:3
Writable.prototype.end@http://localhost:10080/Archive/redoc.min.js:31872:41
ClientRequest.prototype.end@http://localhost:10080/Archive/redoc.min.js:98873:2
get@http://localhost:10080/Archive/redoc.min.js:49619:2
get/<@http://localhost:10080/Archive/redoc.min.js:72829:15
ZoneAwarePromise@http://localhost:10080/Archive/redoc.min.js:100641:29
get@http://localhost:10080/Archive/redoc.min.js:72825:10
download/<@http://localhost:10080/Archive/redoc.min.js:72786:5
ZoneAwarePromise@http://localhost:10080/Archive/redoc.min.js:100641:29
download@http://localhost:10080/Archive/redoc.min.js:72781:10
readHttp@http://localhost:10080/Archive/redoc.min.js:72766:12
getResult@http://localhost:10080/Archive/redoc.min.js:73008:12
runNextPlugin@http://localhost:10080/Archive/redoc.min.js:72951:22
exports.run/<@http://localhost:10080/Archive/redoc.min.js:72940:5
ZoneAwarePromise@http://localhost:10080/Archive/redoc.min.js:100641:29
exports.run@http://localhost:10080/Archive/redoc.min.js:72939:10
readFile/<@http://localhost:10080/Archive/redoc.min.js:43645:5
ZoneAwarePromise@http://localhost:10080/Archive/redoc.min.js:100641:29
readFile@http://localhost:10080/Archive/redoc.min.js:43636:10
parse@http://localhost:10080/Archive/redoc.min.js:43608:12
$RefParser.prototype.parse@http://localhost:10080/Archive/redoc.min.js:71692:15
$RefParser.prototype.resolve@http://localhost:10080/Archive/redoc.min.js:71745:10
$RefParser.prototype.bundle@http://localhost:10080/Archive/redoc.min.js:71787:10
SpecManager</SpecManager.prototype.load/promise<@http://localhost:10080/Archive/redoc.min.js:3403:13
ZoneAwarePromise@http://localhost:10080/Archive/redoc.min.js:100641:29
SpecManager</SpecManager.prototype.load@http://localhost:10080/Archive/redoc.min.js:3401:23
Redoc_1</Redoc.prototype.load@http://localhost:10080/Archive/redoc.min.js:41671:9
Redoc_1</Redoc.prototype.ngOnInit@http://localhost:10080/Archive/redoc.min.js:41711:9
Wrapper_Redoc</Wrapper_Redoc.prototype.ngDoCheck@http://localhost:10080/Archive/redoc.min.js:61991:17
View_Redoc_Host0</View_Redoc_Host0.prototype.detectChangesInternal@http://localhost:10080/Archive/redoc.min.js:62039:9
AppView</AppView.prototype.detectChanges@http://localhost:10080/Archive/redoc.min.js:3114:9

@RomanHotsiy
Copy link
Member

RomanHotsiy commented Feb 2, 2017

@seanpk from the stacktrace I can say that issue is really related to #179.
This will be resolved once I merge another branch with fix (planed to happen till the end of this week)

Try remove description field.
If all is good without description, it would be great if you can localise the exact peace of text in description that causes the bug so I can make sure the issue is not here in the new version.

@seanpk
Copy link
Author

seanpk commented Feb 2, 2017

Removing info.description gets the spec to render.

There are some interesting warnings that show up there too (I won't paste them here now, but will look into them and see whether they're relevant.

Even just removing the text before the first h1 seems to do the trick.
As does adding another header at the top. But then the second h1 is not rendered and shows up as the makrdown # General Notes

This all seems to be in support of the idea that this is a duplicate of #179.

Thanks for your help! I'll look forward to the new release.

@RomanHotsiy
Copy link
Member

@seanpk, verify plz on the latest version v1.8.0

@RomanHotsiy
Copy link
Member

@seanpk closing this for now. Feel free to reopen in case it is still reproducable

@seanpk
Copy link
Author

seanpk commented Feb 6, 2017

closing the loop: it's fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants