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
Node 22 read an imported file's nearest package.json to determine whether it's a cjs or mjs module. The retoolrpc package contains a malformed package.json file in dist/cjs/package.json: the contents are "{\"type\":\"commonjs\"}" (double-JSON-encoded; appears to be a bug on this line where you're both explicitly JSON.stringify-ing, and using fs.writeFileJSON).
This causes an error when importing the module with commonjs in Node 22:
Error: Invalid package config .../node_modules/retoolrpc/dist/cjs/package.json.
at Object.getNearestParentPackageJSON (node:internal/modules/package_json_reader:111:33)
at node:internal/modules/cjs/loader:1654:35
at require.extensions..jsx.require.extensions..js (/.../ts-node-dev-hook-12651585434515367.js:114:20)
at Object.nodeDevHook [as .js] (.../node_modules/ts-node-dev/lib/hook.js:63:13)
at Module.load (node:internal/modules/cjs/loader:1318:32)
at Function._load (node:internal/modules/cjs/loader:1128:12)
at TracingChannel.traceSync (node:diagnostics_channel:315:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
at Module.<anonymous> (node:internal/modules/cjs/loader:1340:12)
at Module.Hook.Module.require (.../node_modules/dd-trace/packages/dd-trace/src/ritm.js:85:33)
The text was updated successfully, but these errors were encountered:
@benweissmann Hey I had the same issue. I think this project is DOA from retool's perspective. The lead maintainer left and nobody is really picking it up. To fix the issue I installed patch-package then adde a patch for that file, that replaces the escaped JSON with un-escaped / normal JSON.
Node 22 read an imported file's nearest package.json to determine whether it's a cjs or mjs module. The
retoolrpc
package contains a malformedpackage.json
file indist/cjs/package.json
: the contents are"{\"type\":\"commonjs\"}"
(double-JSON-encoded; appears to be a bug on this line where you're both explicitly JSON.stringify-ing, and usingfs.writeFileJSON
).This causes an error when importing the module with commonjs in Node 22:
The text was updated successfully, but these errors were encountered: