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
// backend/node_modules/graphql-config/esm/helpers/cosmiconfig.js
var import_module = require("module");
var import_url = require("url");
var import_cosmiconfig = __toESM(require_dist14(), 1);
var import_string_env_interpolation = __toESM(require_index_cjs(), 1);
var import_jiti = __toESM(require_lib11(), 1);
var import_meta = {};
var require2 = (0, import_module.createRequire)(import_meta.url);
var __filename2 = (0, import_url.fileURLToPath)(import_meta.url);
var legacySearchPlaces = [
".graphqlconfig",
".graphqlconfig.json",
".graphqlconfig.yaml",
".graphqlconfig.yml"
];
but at runtime this blows up with this error:
{
"errorType": "TypeError",
"errorMessage": "The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined",
"code": "ERR_INVALID_ARG_VALUE",
"stack": [
"TypeError [ERR_INVALID_ARG_VALUE]: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received undefined",
" at new NodeError (node:internal/errors:405:5)",
" at createRequire (node:internal/modules/cjs/loader:1505:11)",
" at Object.<anonymous> (/var/task/backend-build/handlers/graphql/index.js:353593:48)",
" at Module._compile (node:internal/modules/cjs/loader:1364:14)",
" at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)",
" at Module.load (node:internal/modules/cjs/loader:1203:32)",
" at Module._load (node:internal/modules/cjs/loader:1019:12)",
" at Module.require (node:internal/modules/cjs/loader:1231:19)",
" at require (node:internal/modules/helpers:177:18)",
" at _tryRequireFile (file:///var/runtime/index.mjs:1002:37)"
]
}
my workaround sin is using sed to update the bundle which works:
# Try to replace the import_meta line with macOS sed syntax
if ! sed -i '' 's|var import_meta = {};|var import_meta = { url: import_url.pathToFileURL(__filename
).href };|' backend-build/handlers/graphql/index.js; then
# If the macOS sed syntax fails, try the GNU sed syntax
sed -i 's|var import_meta = {};|var import_meta = { url: import_url.pathToFileURL(__filename).href
};|' backend-build/handlers/graphql/index.js
fi
by any chance is there something that should be changed in graphql-config to avoid this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When I compile my application code which uses graphql-config to commonjs via esbuild and this esbuild config:
it produces this in my bundle:
but at runtime this blows up with this error:
my workaround sin is using sed to update the bundle which works:
by any chance is there something that should be changed in graphql-config to avoid this?
Beta Was this translation helpful? Give feedback.
All reactions