I did a fresh install of fdk just to be sure that my debugging wasn’t a factor, and I get the same error. Here’s the stacktrace with the correct line numbers from un-altered version of fdk:
$ fdk run
Please ensure that the following are addressed for quick review process:
⚠ app/scripts/app.js::5: 'onInit' is never reassigned. Use 'const' instead.
⚠ app/scripts/app.js::17: 'textElement' is never reassigned. Use 'const' instead.
Starting local testing server at http://*:10001/
Append 'dev=true' to your Freshchat account URL to start testing
e.g. https://web.freshchat.com/a/230117337757345/inbox/3/0/conversation/233020826993979?dev=true
Quit the server with Control-C.
TypeError: Cannot read properties of undefined (reading 'location')
at addScopeToURLs (/usr/local/Cellar/fdk/64/custom_node_location/lib/node_modules/fdk/lib/routes/iframe.js:107:53)
at iframeAPIHandler (/usr/local/Cellar/fdk/64/custom_node_location/lib/node_modules/fdk/lib/routes/iframe.js:150:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
undefined
Uncaught exception thrown: Cannot read properties of undefined (reading 'location')
Stack Trace: TypeError: Cannot read properties of undefined (reading 'location')
at addScopeToURLs (/usr/local/Cellar/fdk/64/custom_node_location/lib/node_modules/fdk/lib/routes/iframe.js:107:53)
at iframeAPIHandler (/usr/local/Cellar/fdk/64/custom_node_location/lib/node_modules/fdk/lib/routes/iframe.js:150:14)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Here are two past reports of the same issue: