After an upgrade from node 18 to 20.15.1 I’m running in this error below when I try to render the email template from react email preview server.
Unhandled Runtime Error
Error: The "to" argument must be of type string. Received null
Source
src/utils/improve-error-with-sourcemap.ts (27:28) @ path
25 | ? `${line ?? ''}${line && column ? ':' : ''}${column ?? ''}`
26 | : undefined;
> 27 | const sourceToDisplay = path.relative(sourceRoot, source);
| ^
28 | return methodName === '<unknown>'
29 | ? ` at ${sourceToDisplay}${columnAndLine ? `:${columnAndLine}` : ''}`
30 | : ` at ${methodName} (${sourceToDisplay}${
Call Stack
getStackLineFromMethodNameAndSource
src/utils/improve-error-with-sourcemap.ts (48:12)
error
src/utils/get-email-component.ts (114:39)
async $$ACTION_0
src/actions/render-email-by-path.tsx (22:17)
async Page
src/app/preview/[...slug]/page.tsx (44:31)
These are my dependencies
"@anatine/zod-mock": "3.13.4",
"@faker-js/faker": "8.4.1",
"@types/bull": "3.14.3",
"@types/common-tags": "1.8.4",
"@types/jest": "29.5.12",
"@types/node": "20.14.10",
"@types/nodemailer": "6.4.15",
"@types/uuid": "10.0.0",
"@typescript-eslint/eslint-plugin": "4.22.0",
"@typescript-eslint/parser": "4.22.0",
"apidoc": "0.50.3",
"chalk": "5.3.0",
"commander": "12.1.0",
"copyfiles": "2.4.1",
"easy-table": "1.2.0",
"esbuild": "0.23.0",
"eslint": "7.24.0",
"eslint-config-airbnb-base": "14.2.1",
"eslint-config-prettier": "8.2.0",
"eslint-import-resolver-module-alias": "github:tenfold/eslint-import-resolver-module-alias",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-prettier": "3.4.0",
"husky": "6.0.0",
"jest": "29.7.0",
"jest-html-reporter": "3.10.2",
"jsdoc": "4.0.3",
"koa-logger": "3.2.1",
"lint-staged": "10.5.4",
"minami": "1.2.3",
"minimist": "1.2.8",
"npm-run-all": "4.1.5",
"open": "8.0.6",
"open-cli": "7.1.0",
"ora": "8.0.1",
"pino-pretty": "11.2.1",
"prettier": "2.2.1",
"react-test-renderer": "18.3.1",
"rimraf": "3.0.2",
"shelljs": "0.8.5",
"supertest": "3.4.2",
"ts-jest": "29.2.2",
"ts-node": "10.9.2",
"tsconfig-paths": "4.2.0",
"tsx": "4.16.2",
"typescript": "5.5.3",
"wait-on": "7.2.0"
The problem happens when I call this function i18n.i18nSetup()
inside the preview component like this
And …this is the definition of the function above mentioned
I have no idea how to fix it.