[ ] other (Please do not submit support requests here (below))
This is pretty easy to replicate:
import UniversalRouterSync from 'universal-router/sync'
import generateUrls from 'universal-router/generateUrls'
const router = new UniversalRouter([])
const url = generateUrls(router)
The above code throws an error with the message An instance of UniversalRouter is expected.
Looking at the source it's pretty easy to understand why. The implementation of generateUrls() checks explicitly for instanceof UniversalRouter, and UniversalRouterSync does not inherit from UniversalRouter.
I'm submitting a ...
This is pretty easy to replicate:
The above code throws an error with the message
An instance of UniversalRouter is expected
.Looking at the source it's pretty easy to understand why. The implementation of
generateUrls()
checks explicitly forinstanceof UniversalRouter
, andUniversalRouterSync
does not inherit fromUniversalRouter
.