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
App won't crash, the GraphQL API would build based on my db schema.
Actual results
A serious error occurred when building the initial schema. Exiting because `retryOnInitFail` is not set. Error details:
TypeError: highlightOrNot is not a function
at D:\Projects\agd\test\node_modules\graphile-build-pg\node8plus\plugins\PgBasicsPlugin.js:205:17
at Array.forEach (<anonymous>)
at D:\Projects\agd\test\node_modules\graphile-build-pg\node8plus\plugins\PgBasicsPlugin.js:204:16
at Array.reduce (<anonymous>)
at Object.sqlCommentByAddingTags (D:\Projects\agd\test\node_modules\graphile-build-pg\node8plus\plugins\PgBasicsPlugin.js:200:37)
at D:\Projects\agd\test\node_modules\graphile-build-pg\node8plus\plugins\PgConnectionArgOrderBy.js:46:159
at Array.forEach (<anonymous>)
at D:\Projects\agd\test\node_modules\graphile-build-pg\node8plus\plugins\PgConnectionArgOrderBy.js:27:38
at SchemaBuilder.applyHooks (D:\Projects\agd\test\node_modules\graphile-build\node8plus\SchemaBuilder.js:264:20)
at SchemaBuilder.createBuild (D:\Projects\agd\test\node_modules\graphile-build\node8plus\SchemaBuilder.js:325:10)
My main goal here is to use Deno (especially Deno Deploy) and Postgraphile. This would be amazing. Really, really fast way to have a full GraphQL API deployed and running.
I've tried changing locally the file where the error happens (PgBasicsPlugin) and it fixed the problem.
There is a similar issue with graphile-migrate. Would be really nice to use Deno + Migrate as well.
If you would like to try it with Deno, install Deno and run the following command:
deno run -A main.js
NOTE: When using Deno you have to explicitly allow security sensitive functions. The -A will grant all permissions. More info here.
main.js
// @deno-types="npm:@types/express@4.17.15"
import express from "npm:express@4.18.2";
import postgraphile from "npm:postgraphile@4.13.0";
const app = express();
app.use(
postgraphile.default(
"DB_URL",
"DB_SCHEMA",
{
watchPg: true,
graphiql: true,
enhanceGraphiql: true,
}
)
);
app.listen(8000, () => {
console.log("Listening on port 8000...");
});
The text was updated successfully, but these errors were encountered:
conradoac
changed the title
Outdated chalk dependency breaks Postgraphile when running with --disable-proto=delete or using Deno
Outdated chalk dependency breaks Postgraphile when running with --disable-proto=delete or using DenoDec 24, 2023
Please could you test with postgraphile@beta (PostGraphile V5)? I'm unlikely to make changes to PostGraphile V4 that involve major version bumps of dependencies just to accomodate alternative runtimes.
Summary
I have been trying to run Postgraphile using Deno with no success.
After some research I realized the same issue occurs when running it using Node.js with the
--disable-proto=delete
option.Steps to reproduce
Run the following command:
node --disable-proto=delete main.js
main.js
Expected results
App won't crash, the GraphQL API would build based on my db schema.
Actual results
Possible Solution
It seems the issue is related to an outdated chalk dependency.
The following discussions helped me reach this conclusion:
Object.setPrototypeOf
as__proto__
could potentially be disabled chalk/chalk#387Additional context
PgBasicsPlugin
) and it fixed the problem.If you would like to try it with Deno, install Deno and run the following command:
deno run -A main.js
NOTE: When using Deno you have to explicitly allow security sensitive functions. The
-A
will grant all permissions. More info here.main.js
The text was updated successfully, but these errors were encountered: