Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Critical dependency: require function is used in a way in which dependencies cannot be statically extracted #62

Closed
2 tasks done
bmakr opened this issue Nov 17, 2023 · 17 comments

Comments

@bmakr
Copy link

bmakr commented Nov 17, 2023

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug

I'm receiving this warning (wasn't receiving previous to reinstalling from package.json):

./node_modules/node-gyp-build/index.js
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

Import trace for requested module:
./node_modules/node-gyp-build/index.js
./node_modules/bufferutil/index.js
./node_modules/websocket/lib/WebSocketFrame.js
./node_modules/websocket/lib/websocket.js
./node_modules/websocket/index.js
./node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js
./node_modules/@supabase/realtime-js/dist/main/index.js
./node_modules/@supabase/supabase-js/dist/main/index.js
./app/api/supabase/createClient.ts
./app/api/supabase/index.ts
./app/api/index.ts
./app/decks/ai/create/[id]/page.tsx

When I uninstall "@supabase/supabase-js": "^2.33.1", from the app and remove the client code:

import { SupabaseClient, createClient } from "@supabase/supabase-js";


const supabaseUrl = process.env.SUPABASE_URL;
const supabaseKey = process.env.SUPABASE_ANON_KEY;

export const supabase = createClient<SupabaseClient<any, "public", any>>(
    `${supabaseUrl}`, 
    `${supabaseKey}`,
    {
        auth: {
            persistSession: false
        }
    }
);

The warning goes away.

To Reproduce

  1. Install the package in a nextjs app
  2. run next dev

Expected behavior

I expect there to be no warning as nothing seems to be wrong with the code in node-gyp (however I could be wrong) which is added by websocket:

if (typeof require.addon === 'function') { // if the platform supports native resolving prefer that
  module.exports = require.addon.bind(require)
} else { // else use the runtime version here
  module.exports = require('./node-gyp-build.js')
}

System information

  • MacOS Sonoma
  • next dev cli
  • Version of supabase-js: "@supabase/supabase-js": "^2.33.1",
  • Version of Node.js: happens in both 16 and 18

Additional context

Let me know if you have any insights on how to remedy or turn off the warning

@vweevers
Copy link
Member

cc @kasperisager @mafintosh because you added require.addon in #61. What platform is that for?

@kasperisager
Copy link
Contributor

@bmackio @vweevers If this can be fixed without eval() then I'm all ears! We need this for our custom JavaScript runtime.

@vweevers
Copy link
Member

Would something like this work?

// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'
var runtimeRequire = typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require // eslint-disable-line

@mafintosh
Copy link
Collaborator

We can try for sure

@mafintosh
Copy link
Collaborator

Can someone verify if this fixes the issue: #63

@bmakr
Copy link
Author

bmakr commented Nov 21, 2023

@mafintosh injecting that code did not work locally on my machine. I think the issue is the conditional as webpack seems to be "requiring" a static import, which conflicts with the use case internally for node-pre-gyp

I'm going to lookin into the following code on webpack to try to understand the source of the message a little better before I circle back:

const requireAsExpressionHandler = expr => {
			const dep = new CommonJsRequireContextDependency(
				{
					request: options.unknownContextRequest,
					recursive: options.unknownContextRecursive,
					regExp: options.unknownContextRegExp,
					mode: "sync"
				},
				/** @type {Range} */ (expr.range),
				undefined,
				parser.scope.inShorthand,
				getContext()
			);
			dep.critical =
				options.unknownContextCritical &&
				"require function is used in a way in which dependencies cannot be statically extracted";
			dep.loc = /** @type {DependencyLocation} */ (expr.loc);
			dep.optional = !!parser.scope.inTry;
			parser.state.current.addDependency(dep);
			return true;
		};

@bmakr
Copy link
Author

bmakr commented Nov 21, 2023

I could not find where the warning gets triggered in webpack, so I started a disucssion thread on webpack to try to better understand their requirements: webpack/webpack#17819

@bmakr
Copy link
Author

bmakr commented Nov 21, 2023

The issue could be due to a modified output in the build: webpack/webpack#16793

I'll continue to investigate as I have time, but need to get back to what I was doing. If anyone can identify the way in which next/typescript changes the node-gyp-build require statement (if at all) that will reveal the actual statement webpack is reading and may tell us why the warning is being triggered

@bmakr
Copy link
Author

bmakr commented Nov 21, 2023

If I do a static build, by adding:

const nextConfig = {
    distDir: 'dist',
    output: 'export',

My dist/server/vendor-chunks/node-gyp-build.js looks like this:

"use strict";
/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
exports.id = "vendor-chunks/node-gyp-build";
exports.ids = ["vendor-chunks/node-gyp-build"];
exports.modules = {

/***/ "(rsc)/./node_modules/node-gyp-build/index.js":
/*!**********************************************!*\
  !*** ./node_modules/node-gyp-build/index.js ***!
  \**********************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("\nif (typeof __webpack_require__(\"(rsc)/./node_modules/node-gyp-build sync recursive\").addon === \"function\") {\n    module.exports = __webpack_require__(\"(rsc)/./node_modules/node-gyp-build sync recursive\").addon.bind(__webpack_require__(\"(rsc)/./node_modules/node-gyp-build sync recursive\"));\n} else {\n    module.exports = __webpack_require__(/*! ./node-gyp-build.js */ \"(rsc)/./node_modules/node-gyp-build/node-gyp-build.js\");\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbm9kZS1neXAtYnVpbGQvaW5kZXguanMiLCJtYXBwaW5ncyI6IjtBQUFBLElBQUksT0FBT0EseUVBQU9BLENBQUNDLEtBQUssS0FBSyxZQUFZO0lBQ3ZDQyxPQUFPQyxPQUFPLEdBQUdILHlFQUFPQSxDQUFDQyxLQUFLLENBQUNHLElBQUksQ0FBQ0oseUVBQU9BO0FBQzdDLE9BQU87SUFDTEUsd0hBQXlCO0FBQzNCIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vdmVyY2VsLWt2LXJlZGlzLXN0YXJ0ZXIvLi9ub2RlX21vZHVsZXMvbm9kZS1neXAtYnVpbGQvaW5kZXguanM/MGI0NyJdLCJzb3VyY2VzQ29udGVudCI6WyJpZiAodHlwZW9mIHJlcXVpcmUuYWRkb24gPT09ICdmdW5jdGlvbicpIHsgLy8gaWYgdGhlIHBsYXRmb3JtIHN1cHBvcnRzIG5hdGl2ZSByZXNvbHZpbmcgcHJlZmVyIHRoYXRcbiAgbW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlLmFkZG9uLmJpbmQocmVxdWlyZSlcbn0gZWxzZSB7IC8vIGVsc2UgdXNlIHRoZSBydW50aW1lIHZlcnNpb24gaGVyZVxuICBtb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vbm9kZS1neXAtYnVpbGQuanMnKVxufVxuIl0sIm5hbWVzIjpbInJlcXVpcmUiLCJhZGRvbiIsIm1vZHVsZSIsImV4cG9ydHMiLCJiaW5kIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/node-gyp-build/index.js\n");

/***/ }),

/***/ "(rsc)/./node_modules/node-gyp-build/node-gyp-build.js":
/*!*******************************************************!*\
  !*** ./node_modules/node-gyp-build/node-gyp-build.js ***!
  \*******************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

eval("\nvar fs = __webpack_require__(/*! fs */ \"fs\");\nvar path = __webpack_require__(/*! path */ \"path\");\nvar os = __webpack_require__(/*! os */ \"os\");\n// Workaround to fix webpack's build warnings: 'the request of a dependency is an expression'\nvar runtimeRequire =  true ? require : 0 // eslint-disable-line\n;\nvar vars = process.config && process.config.variables || {};\nvar prebuildsOnly = !!process.env.PREBUILDS_ONLY;\nvar abi = process.versions.modules // TODO: support old node where this is undef\n;\nvar runtime = isElectron() ? \"electron\" : isNwjs() ? \"node-webkit\" : \"node\";\nvar arch = process.env.npm_config_arch || os.arch();\nvar platform = process.env.npm_config_platform || os.platform();\nvar libc = process.env.LIBC || (isAlpine(platform) ? \"musl\" : \"glibc\");\nvar armv = process.env.ARM_VERSION || (arch === \"arm64\" ? \"8\" : vars.arm_version) || \"\";\nvar uv = (process.versions.uv || \"\").split(\".\")[0];\nmodule.exports = load;\nfunction load(dir) {\n    return runtimeRequire(load.resolve(dir));\n}\nload.resolve = load.path = function(dir) {\n    dir = path.resolve(dir || \".\");\n    try {\n        var name = runtimeRequire(path.join(dir, \"package.json\")).name.toUpperCase().replace(/-/g, \"_\");\n        if (process.env[name + \"_PREBUILD\"]) dir = process.env[name + \"_PREBUILD\"];\n    } catch (err) {}\n    if (!prebuildsOnly) {\n        var release = getFirst(path.join(dir, \"build/Release\"), matchBuild);\n        if (release) return release;\n        var debug = getFirst(path.join(dir, \"build/Debug\"), matchBuild);\n        if (debug) return debug;\n    }\n    var prebuild = resolve(dir);\n    if (prebuild) return prebuild;\n    var nearby = resolve(path.dirname(process.execPath));\n    if (nearby) return nearby;\n    var target = [\n        \"platform=\" + platform,\n        \"arch=\" + arch,\n        \"runtime=\" + runtime,\n        \"abi=\" + abi,\n        \"uv=\" + uv,\n        armv ? \"armv=\" + armv : \"\",\n        \"libc=\" + libc,\n        \"node=\" + process.versions.node,\n        process.versions.electron ? \"electron=\" + process.versions.electron : \"\",\n         true ? \"webpack=true\" : 0 // eslint-disable-line\n    ].filter(Boolean).join(\" \");\n    throw new Error(\"No native build was found for \" + target + \"\\n    loaded from: \" + dir + \"\\n\");\n    function resolve(dir) {\n        // Find matching \"prebuilds/<platform>-<arch>\" directory\n        var tuples = readdirSync(path.join(dir, \"prebuilds\")).map(parseTuple);\n        var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0];\n        if (!tuple) return;\n        // Find most specific flavor first\n        var prebuilds = path.join(dir, \"prebuilds\", tuple.name);\n        var parsed = readdirSync(prebuilds).map(parseTags);\n        var candidates = parsed.filter(matchTags(runtime, abi));\n        var winner = candidates.sort(compareTags(runtime))[0];\n        if (winner) return path.join(prebuilds, winner.file);\n    }\n};\nfunction readdirSync(dir) {\n    try {\n        return fs.readdirSync(dir);\n    } catch (err) {\n        return [];\n    }\n}\nfunction getFirst(dir, filter) {\n    var files = readdirSync(dir).filter(filter);\n    return files[0] && path.join(dir, files[0]);\n}\nfunction matchBuild(name) {\n    return /\\.node$/.test(name);\n}\nfunction parseTuple(name) {\n    // Example: darwin-x64+arm64\n    var arr = name.split(\"-\");\n    if (arr.length !== 2) return;\n    var platform = arr[0];\n    var architectures = arr[1].split(\"+\");\n    if (!platform) return;\n    if (!architectures.length) return;\n    if (!architectures.every(Boolean)) return;\n    return {\n        name,\n        platform,\n        architectures\n    };\n}\nfunction matchTuple(platform, arch) {\n    return function(tuple) {\n        if (tuple == null) return false;\n        if (tuple.platform !== platform) return false;\n        return tuple.architectures.includes(arch);\n    };\n}\nfunction compareTuples(a, b) {\n    // Prefer single-arch prebuilds over multi-arch\n    return a.architectures.length - b.architectures.length;\n}\nfunction parseTags(file) {\n    var arr = file.split(\".\");\n    var extension = arr.pop();\n    var tags = {\n        file: file,\n        specificity: 0\n    };\n    if (extension !== \"node\") return;\n    for(var i = 0; i < arr.length; i++){\n        var tag = arr[i];\n        if (tag === \"node\" || tag === \"electron\" || tag === \"node-webkit\") {\n            tags.runtime = tag;\n        } else if (tag === \"napi\") {\n            tags.napi = true;\n        } else if (tag.slice(0, 3) === \"abi\") {\n            tags.abi = tag.slice(3);\n        } else if (tag.slice(0, 2) === \"uv\") {\n            tags.uv = tag.slice(2);\n        } else if (tag.slice(0, 4) === \"armv\") {\n            tags.armv = tag.slice(4);\n        } else if (tag === \"glibc\" || tag === \"musl\") {\n            tags.libc = tag;\n        } else {\n            continue;\n        }\n        tags.specificity++;\n    }\n    return tags;\n}\nfunction matchTags(runtime, abi) {\n    return function(tags) {\n        if (tags == null) return false;\n        if (tags.runtime !== runtime && !runtimeAgnostic(tags)) return false;\n        if (tags.abi !== abi && !tags.napi) return false;\n        if (tags.uv && tags.uv !== uv) return false;\n        if (tags.armv && tags.armv !== armv) return false;\n        if (tags.libc && tags.libc !== libc) return false;\n        return true;\n    };\n}\nfunction runtimeAgnostic(tags) {\n    return tags.runtime === \"node\" && tags.napi;\n}\nfunction compareTags(runtime) {\n    // Precedence: non-agnostic runtime, abi over napi, then by specificity.\n    return function(a, b) {\n        if (a.runtime !== b.runtime) {\n            return a.runtime === runtime ? -1 : 1;\n        } else if (a.abi !== b.abi) {\n            return a.abi ? -1 : 1;\n        } else if (a.specificity !== b.specificity) {\n            return a.specificity > b.specificity ? -1 : 1;\n        } else {\n            return 0;\n        }\n    };\n}\nfunction isNwjs() {\n    return !!(process.versions && process.versions.nw);\n}\nfunction isElectron() {\n    if (process.versions && process.versions.electron) return true;\n    if (process.env.ELECTRON_RUN_AS_NODE) return true;\n    return  false && 0;\n}\nfunction isAlpine(platform) {\n    return platform === \"linux\" && fs.existsSync(\"/etc/alpine-release\");\n}\n// Exposed for unit tests\n// TODO: move to lib\nload.parseTags = parseTags;\nload.matchTags = matchTags;\nload.compareTags = compareTags;\nload.parseTuple = parseTuple;\nload.matchTuple = matchTuple;\nload.compareTuples = compareTuples;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiKHJzYykvLi9ub2RlX21vZHVsZXMvbm9kZS1neXAtYnVpbGQvbm9kZS1neXAtYnVpbGQuanMiLCJtYXBwaW5ncyI6IjtBQUFBLElBQUlBLEtBQUtDLG1CQUFPQSxDQUFDO0FBQ2pCLElBQUlDLE9BQU9ELG1CQUFPQSxDQUFDO0FBQ25CLElBQUlFLEtBQUtGLG1CQUFPQSxDQUFDO0FBRWpCLDZGQUE2RjtBQUM3RixJQUFJRyxpQkFBaUIsS0FBK0IsR0FBYUUsT0FBdUJBLEdBQUdMLENBQU9BLENBQUMsc0JBQXNCOztBQUV6SCxJQUFJTSxPQUFPLFFBQVNFLE1BQU0sSUFBSUQsUUFBUUMsTUFBTSxDQUFDQyxTQUFTLElBQUssQ0FBQztBQUM1RCxJQUFJQyxnQkFBZ0IsQ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hbWUiLCJleGVjUGF0aCIsInRhcmdldCIsIm5vZGUiLCJlbGVjdHJvbiIsImZpbHRlciIsIkJvb2xlYW4iLCJFcnJvciIsInR1cGxlcyIsInJlYWRkaXJTeW5jIiwibWFwIiwicGFyc2VUdXBsZSIsInR1cGxlIiwibWF0Y2hUdXBsZSIsInNvcnQiLCJjb21wYXJlVHVwbGVzIiwicHJlYnVpbGRzIiwicGFyc2VkIiwicGFyc2VUYWdzIiwiY2FuZGlkYXRlcyIsIm1hdGNoVGFncyIsIndpbm5lciIsImNvbXBhcmVUYWdzIiwiZmlsZSIsImZpbGVzIiwidGVzdCIsImFyciIsImxlbmd0aCIsImFyY2hpdGVjdHVyZXMiLCJldmVyeSIsImluY2x1ZGVzIiwiYSIsImIiLCJleHRlbnNpb24iLCJwb3AiLCJ0YWdzIiwic3BlY2lmaWNpdHkiLCJpIiwidGFnIiwibmFwaSIsInNsaWNlIiwicnVudGltZUFnbm9zdGljIiwibnciLCJFTEVDVFJPTl9SVU5fQVNfTk9ERSIsIndpbmRvdyIsInR5cGUiLCJleGlzdHNTeW5jIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///(rsc)/./node_modules/node-gyp-build/node-gyp-build.js\n");

/***/ })

};
;

@mafintosh
Copy link
Collaborator

If you give me a command on how to repro that error/warning locally, I'm happy to iterate here also

@bmakr
Copy link
Author

bmakr commented Nov 21, 2023

@samducker
Copy link

Any idea of how to surpress this warning in the meantime?

@vweevers
Copy link
Member

@samducker You can pin to node-gyp-build 4.6.1, which doesn't have this issue.

@exceedxo
Copy link

exceedxo commented Nov 23, 2023

#62 (comment)

Thank you, this fixed my issues!

@mafintosh
Copy link
Collaborator

Fixed in 4.7.1

@mafintosh
Copy link
Collaborator

If anyone can repro please post here how after (you need to remove that .next cache mb, i had to)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants