`useTypedLoaderData` Syntax Error during another Error
See original GitHub issueTrying to reproduce with a minimal example:
export const loader = async ({
request,
}: LoaderArgs): Promise<TypedJsonResponse<LoaderData>> => {
const data = {
date: new Date()
};
return typedjson(data);
};
export default function Dashboard(): JSX.Element {
const loaderData = useTypedLoaderData<typeof loader>();
const { date } = loaderData;
// Purposefully throw an error to show issue
throw new Error("TEST")
return null;
}
Error message in browser console window:
Uncaught SyntaxError: Unexpected identifier 'Nov'
When checking the file its talking about in Sources tab You’ll see something like this in the file:
'routeData':{'routes/dashboard': {'date':Thu Nov 03 2022 11:04:25 GMT-0400 (Eastern Daylight Time)}}'
Seems like the typedjson
is causing syntax errors somewhere due to the type conversions?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
In SQL, is it a syntax error to appoint a different datatype ...
So obviously there's a mistake because the Foreign Key DozentNr is declared as a CHAR, while the Primary Key it references is of...
Read more >ASA messages
SYNTAX ERROR IN PARMLIB MEMBER=memname LINE line-number: symbol1 EXPECTED BEFORE symbol2. DETECTING MODULE IS detmod. INPUT LINE: input-line; ASA003I
Read more >Invalid Syntax in Python: Common Reasons for SyntaxError
If you've ever received a SyntaxError when trying to run your Python code, ... The interpreter will attempt to show you where that...
Read more >How to Handle the Syntax Error in Javascript
The Javascript SyntaxError is thrown when the engine comes across tokens or token orders with incorrect syntax when parsing code.
Read more >SyntaxError - JavaScript - MDN Web Docs
The SyntaxError object represents an error when trying to interpret syntactically invalid code. It is thrown when the JavaScript engine encounters tokens or ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Updated to
"@remix-run/dev": "^1.7.5",
and i think it fixed it lolI can’t seem to repro this when I clone this https://github.com/mui/material-ui/tree/master/examples/remix-with-typescript and try to recreate it, which uses emotion and MUI also.