adamsoffer/next-apollo

This dependency was not found: ./node_modules/next-apollo/dist/link.js

Closed this issue ยท 5 comments

"next-apollo": "^2.0.8",
This might be user error on my part, but I'm getting the following error below.

This dependency was not found:

  • next/dist/lib/utils in ./node_modules/next-apollo/dist/link.js

The issue occurs for me after upgrading NextJS from version 7.0.2 to version 8.0.0

Inside ./node_modules/next-apollo/dist/link.js a variable is declared _utils which is no longer available as of NextJS Version 8.0.0.

After removing lines 58 & 257-259 the error no longer occurs.

Line 58
var _utils = require("next/dist/lib/utils");

Line 257-259

if (typeof value === 'string') {
    (0, _utils.execOnce)(_utils.warn)("Warning: You're using a string directly inside <Link>. This usage has been deprecated. Please add an <a> tag as child of <Link>");
 }

link.js is attempting to use functions (execOnce & warn) which is a function found inside the utils.js file from Next to display the following message:

Warning: You're using a string directly inside . This usage has been deprecated. Please add an a tag as child of Link

Thanks for reporting this. Looks like next/dist/lib/utils moved to next-server/dist/lib/utils. Updating this path fixed that error, however, I'm currently testing with Next v8 and looks like the way we're doing data prefetching is no longer working. Will investigate.

I have the same problem, can you guys fix the dependency link?

Hey guys - I just pushed a fix in v2.0.9 that address this dependency error. Let me know if that fixed it for you. I'll open up a separate issue re: data prefetching no longer working.

Yes, I just updated dependency and the error no longer occurs on Next v8+. Thanks @adamsoffer! ๐Ÿ‘