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
Not sure if this is a fair point, but when creating a +page.server.ts/js file, I noticed that I was getting the following error, thereby preventing a page load:
TypeError: inspect is not a function at URL.tracked.<computed> (file:///C:/Users/.../node_modules/@sveltejs/kit/src/utils/url.js:109:11) at formatValue (node:internal/util/inspect:763:19) at formatProperty (node:internal/util/inspect:1681:11) at formatRaw (node:internal/util/inspect:1006:9) at formatValue (node:internal/util/inspect:793:10) at inspect (node:internal/util/inspect:340:10) at formatWithOptionsInternal (node:internal/util/inspect:2006:40) at formatWithOptions (node:internal/util/inspect:1888:10) at console.value (node:internal/console/constructor:323:14) at console.log (node:internal/console/constructor:359:61) This is caused by either a bug in Node.js or incorrect usage of Node.js internals. Please open an issue with this stack trace at https://github.com/nodejs/node/issues
I went into utils/url.js (line 109) and noticed that the inspect function was reliant on it being passed to tracked[Symbol.for('nodejs.util.inspect.custom')] = (depth, opts, inspect) => {...}. I assume in my case, this was not happening. To get around this, I just added this to the top of url.js import util from 'util' and changed the constant's function to this:
This fixed my issue and (after some brief testing) without detriment to the underlying functionality of Sveltekit.
Please let me know if this will have long-term consequences to my code.
Thanks in advance.
Reproduction
This bug report is just an explanation of a bug in my particular instance.
Logs
TypeError: inspect is not a function
at URL.tracked.<computed> (file:///C:/Users/.../node_modules/@sveltejs/kit/src/utils/url.js:109:11)
at formatValue (node:internal/util/inspect:763:19)
at formatProperty (node:internal/util/inspect:1681:11)
at formatRaw (node:internal/util/inspect:1006:9)
at formatValue (node:internal/util/inspect:793:10)
at inspect (node:internal/util/inspect:340:10)
at formatWithOptionsInternal (node:internal/util/inspect:2006:40)
at formatWithOptions (node:internal/util/inspect:1888:10)
at console.value (node:internal/console/constructor:323:14)
at console.log (node:internal/console/constructor:359:61)
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
Putting import 'util' at the top of the file is probably a bad idea because this file is also run on the browser.
The Node docs for util.inspect.custom annoyingly do not say in what version the third argument was added, but it should be there in all of the versions of Node that SvelteKit supports. We should update the pkg.engines.node field to explicitly exclude Node 17, which is not one of the LTS versions of Node. Apart from this, you really should upgrade anyway, because it has been end-of-life since June.
Describe the bug
Not sure if this is a fair point, but when creating a +page.server.ts/js file, I noticed that I was getting the following error, thereby preventing a page load:
I went into utils/url.js (line 109) and noticed that the inspect function was reliant on it being passed to
tracked[Symbol.for('nodejs.util.inspect.custom')] = (depth, opts, inspect) => {...}
. I assume in my case, this was not happening. To get around this, I just added this to the top of url.jsimport util from 'util'
and changed the constant's function to this:This fixed my issue and (after some brief testing) without detriment to the underlying functionality of Sveltekit.
Please let me know if this will have long-term consequences to my code.
Thanks in advance.
Reproduction
This bug report is just an explanation of a bug in my particular instance.
Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: