turbo
turbo copied to clipboard
[Turbopack] Libraries depending on node-gyp-build fail parsing
What version of Turbopack are you using?
latest alpha
What package manager are you using / does the bug impact?
pnpm, Yarn v1
What operating system are you using?
Linux
Describe the Bug
When using a package which depends on node-gyp-build (such as the supabase-js client), turbopack can't compile the app.
It fails with the following output:
error - [resolve] [project-with-next]/node_modules/node-gyp-build/index.js Error resolving commonjs request
unable to resolve dynamic
| It was not possible to find the requested file.
| Parsed request as written in source code: dynamic
| Path where resolving has started: [project-with-next]/node_modules/node-gyp-build/index.js
| Type of request: commonjs request
when I run next dev --turbo --show-all I additionally get this info:
error - [resolve] node_modules/node-gyp-build/index.js
Error resolving commonjs request
unable to resolve dynamic
[parse]
node_modules/node-gyp-build/index.js
node_modules/node-gyp-build/index.js:22:9 lint TP1002 require(???*0*) is very dynamic
18
19 module.exports = load
20
21 function load (dir) {
22 > return runtimeRequire(load.path(dir))
23 }
24
25 load.path = function (dir) {
26 dir = path.resolve(dir || '.')
- *0* ???*1*(???*2*)
⚠️ call of unknown function
- *1* (...) => (??? | ???)["path"]
⚠️ property on function
- *2* arguments[0]
⚠️ cross function analyzing is not yet supported
Expected Behavior
Importing packages which depend on node-gyp-build should work.
To Reproduce
Checkout the repo below. It's an exceedingly minimal Next 13 project.
next dev works as intended.
next dev --turbo will produce the aforementioned error.
Reproduction Repo
https://github.com/Escapado/next-turbo-bug
+1 here with the Supabase client
This is a serious blocker
Any idea how solve this error ?
Any update on this? Still seeing the issue a year later!
still not work in next 13.5
Seeing this in [email protected]
Still happening on Next 14
Yes, Next 14 have this problem
Yep, still happening on Next 14.0.2
Kind of hilariously bad that @vercel/[email protected] (Vercel's own package) breaks Turbopack when using [email protected] with this error. Y'all really need to do some testing before releasing.
Massive blocker here. Unable to use supabase inside components due to this weird error.
I'm using pnpm.
Module not found
It was not possible to find the requested file.
Parsed request as written in source code: dynamic
Path where resolving has started: [project]/node_modules/.pnpm/[email protected]/node_modules/node-gyp-build/node-gyp-build.js
Type of request: commonjs request
Import map: No import map entry
⨯ ModuleBuildError: error - node_modules/.pnpm/[email protected]/node_modules/node-gyp-build/node-gyp-build.js:22:9
Still happening in Next 14.0.3
same problem next 14.0.3
Same
Can confirm this is still an issue with the latest supabase library + nextJS 14.0.3.
Just tested, Next.js 14.0.4 fixes this. Sadly, I'm stuck on Next.js 14.0.3 because Mongoose library does not work with Next.js 14.0.4, therefore I cannot use Turbopack. What a headache man...
Edit: Next.js 14.0.4-canary.37 is the only latest version that works for me as explained here.
This is finally fixed with Next 14.0.4! 🥳
Yeah, fixed!
Closing as fixed. Thank you for trying!