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
<Linkto="this-is-a-resource-route"reloadDocument>This is a link to a resource route.</Link>
If you have such a Link inside a component to which you have applied useDelegatedAnchors, then when you follow the link, it fails with the following client-side error:
error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of RemixRoute. %E2%80%94 https://.../build/entry.client-VNG4R5DS.js:20463
Describe the bug
The Remix docs state that you must use
reloadDocument
to link to resource routes, like this:If you have such a Link inside a component to which you have applied
useDelegatedAnchors
, then when you follow the link, it fails with the following client-side error:error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of
RemixRoute. %E2%80%94 https://.../build/entry.client-VNG4R5DS.js:20463
Your Example Website or App
https://stackblitz.com/edit/remix-run-remix-a55xcd?file=app/routes/_index.tsx
Steps to Reproduce the Bug or Issue
Open and run the StackBlitz. In the Remix app, click the link called "A resource route".
Expected behavior
Your browser should follow the link and display the resource route, which is JSON and looks like this:
Screenshots or Videos
Screen.Recording.2023-05-17.at.17.36.34.mov
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: