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
In the build function, we reference nm (the generated node_modules) in two ways. One is in buildInputs, and the other is by copying / symlinking it into the current directory in the preConfigure phase. Is there a reason we do both of these?
It seems to be causing problems when using next-js. It's also possible I am diagnosing the problem wrong; I am not very familiar with any of the pieces here.
The error I get is:
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
You might have mismatching versions of React and the renderer (such as React DOM)
You might be breaking the Rules of Hooks
You might have more than one copy of React in the same app See for tips about how to debug and fix this problem.
I think the relevant point is "You might have more than one copy of React in the same app." Since the copy it is finding in the error message is the one in the nix store, rather than in the current directory.
When I override as follows:
(pkgs.npmlock2nix.build {
...
}).overrideAttrs (old: {
buildInputs = [ pkgs.nodejs ]; # note that the old contents of `buildInputs` (namely `nm`) is being overwritten
preConfigure = old.preConfigure + ''
chmod u+x node_modules/.bin/*
'';
})
it works.
The text was updated successfully, but these errors were encountered:
In the
build
function, we referencenm
(the generatednode_modules
) in two ways. One is inbuildInputs
, and the other is by copying / symlinking it into the current directory in thepreConfigure
phase. Is there a reason we do both of these?It seems to be causing problems when using
next-js
. It's also possible I am diagnosing the problem wrong; I am not very familiar with any of the pieces here.The error I get is:
I think the relevant point is "You might have more than one copy of React in the same app." Since the copy it is finding in the error message is the one in the nix store, rather than in the current directory.
When I override as follows:
it works.
The text was updated successfully, but these errors were encountered: