Skip to content

Missing dependency find-cache-dir #126

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

Closed
ehmicky opened this issue Mar 11, 2021 · 0 comments · Fixed by #127
Closed

Missing dependency find-cache-dir #126

ehmicky opened this issue Mar 11, 2021 · 0 comments · Fixed by #127
Assignees
Labels
type: bug code to address defects in shipped code

Comments

@ehmicky
Copy link

ehmicky commented Mar 11, 2021

We use the find-cache-dir dependency but do not include it in our package.json dependencies.

https://github.com/netlify/netlify-plugin-nextjs/blob/61b61f57d58ae095e3522c86013c75823911179b/src/lib/steps/prepareFolders.js#L3

https://github.com/netlify/netlify-plugin-nextjs/blob/61b61f57d58ae095e3522c86013c75823911179b/src/lib/helpers/handleFileTracking.js#L3

This creates the following bug in production:

Could not import plugin:
Cannot find module 'find-cache-dir'
Require stack:
- /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/lib/steps/prepareFolders.js
- /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/index.js
- /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/index.js
- /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/logic.js
- /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/load.js
- /opt/buildhome/.netlify-build-nvm/versions/node/v12.16.3/lib/node_modules/@netlify/build/src/plugins/child/main.js 
    internal/modules/cjs/loader.js:957:15 Function.Module._resolveFilename
    internal/modules/cjs/loader.js:840:27 Function.Module._load
    internal/modules/cjs/loader.js:1019:19 Module.require
    internal/modules/cjs/helpers.js:77:18 require
    /opt/build/repo/.netlify/plugins/node_modules/@netlify/plugin-nextjs/src/lib/steps/prepareFolders.js:3:22 Object.<anonymous>
    internal/modules/cjs/loader.js:1133:30 Module._compile
    internal/modules/cjs/loader.js:1153:10 Object.Module._extensions..js
    internal/modules/cjs/loader.js:977:32 Module.load
    internal/modules/cjs/loader.js:877:14 Function.Module._load
    internal/modules/cjs/loader.js:1019:19 Module.require

find-cache-dir is a dependency of next, so it turns out the module can still be required most of the times. However, there are cases where this is not the case, e.g. when next is not a site dependency (see #117).

@ehmicky ehmicky added the type: bug code to address defects in shipped code label Mar 11, 2021
@ehmicky ehmicky self-assigned this Mar 11, 2021
serhalp pushed a commit that referenced this issue Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug code to address defects in shipped code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant