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

Lodash import: cannot find module './fp/_baseConvert' #8523

Closed
4 of 7 tasks
mat2718 opened this issue Jan 7, 2023 · 4 comments
Closed
4 of 7 tasks

Lodash import: cannot find module './fp/_baseConvert' #8523

mat2718 opened this issue Jan 7, 2023 · 4 comments
Labels
external This issue is caused by an external dependency and not Docusaurus.

Comments

@mat2718
Copy link

mat2718 commented Jan 7, 2023

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

 yarn start 
yarn run v1.22.19
$ docusaurus start
node:internal/modules/cjs/loader:1039
  const err = new Error(message);
              ^

Error: Cannot find module './fp/_baseConvert'
Require stack:
- C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\lodash\fp.js
- C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\wait-on\lib\wait-on.js
- C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\@docusaurus\core\lib\webpack\plugins\WaitPlugin.js
- C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\@docusaurus\core\lib\webpack\server.js
- C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\@docusaurus\core\lib\commands\build.js
- C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\@docusaurus\core\lib\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1039:15)
    at Module._load (node:internal/modules/cjs/loader:885:27)
    at Module.require (node:internal/modules/cjs/loader:1105:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\MATTH\OneDrive\Documents\GitHub\vision-camera-face-detector\docs\node_modules\lodash\fp.js:2:18)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
    at Module.load (node:internal/modules/cjs/loader:1081:32)
    at Module._load (node:internal/modules/cjs/loader:922:12)
    at Module.require (node:internal/modules/cjs/loader:1105:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\MATTH\\OneDrive\\Documents\\GitHub\\vision-camera-face-detector\\docs\\node_modules\\lodash\\fp.js',
    'C:\\Users\\MATTH\\OneDrive\\Documents\\GitHub\\vision-camera-face-detector\\docs\\node_modules\\wait-on\\lib\\wait-on.js',
    'C:\\Users\\MATTH\\OneDrive\\Documents\\GitHub\\vision-camera-face-detector\\docs\\node_modules\\@docusaurus\\core\\lib\\webpack\\plugins\\WaitPlugin.js',
    'C:\\Users\\MATTH\\OneDrive\\Documents\\GitHub\\vision-camera-face-detector\\docs\\node_modules\\@docusaurus\\core\\lib\\webpack\\server.js',
    'C:\\Users\\MATTH\\OneDrive\\Documents\\GitHub\\vision-camera-face-detector\\docs\\node_modules\\@docusaurus\\core\\lib\\commands\\build.js',
    'C:\\Users\\MATTH\\OneDrive\\Documents\\GitHub\\vision-camera-face-detector\\docs\\node_modules\\@docusaurus\\core\\lib\\index.js'
  ]
}

Node.js v19.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproducible demo

No response

Steps to reproduce

follow typescript installation.
run in created folder
yarn
yarn start

Expected behavior

for it to work

Actual behavior

MODULE_NOT_FOUND

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Self-service

  • I'd be willing to fix this bug myself.
@mat2718 mat2718 added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jan 7, 2023
@Josh-Cena
Copy link
Collaborator

Just re-confirming: you've tried rm -rf node_modules yarn.lock package-lock.json and re-installing, and the error is still the same?

@mat2718
Copy link
Author

mat2718 commented Jan 8, 2023

Yes that is correct. I've also tried deleting the whole folder and rerunning the npx command and the problem persists

@mat2718
Copy link
Author

mat2718 commented Jan 8, 2023

hello!

turns out the file fp/_baseConvert is missing in the lodash library 4.17.21 but is present in lodash 4.17.15. the wait-on library is the library that has the loadash dependency. long story short i added a resolution to the package.json and set lodash to 4.17.15 and the server started right up

"resolutions": {
    "lodash": "4.17.15"
  },

@Josh-Cena Josh-Cena added external This issue is caused by an external dependency and not Docusaurus. and removed bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jan 10, 2023
@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Jan 10, 2023

Thanks for looking into this. Weirdly, I do see node_modules/lodash/fp/_baseConvert.js in my node_modules, even with lodash 4.17.21. Unfortunately, because this issue is entirely external (it's caused by a lodash-internal import, which itself is triggered by an import from wait-on), we cannot act on this even if it turns out to be valid (which I can't verify). I'm going to close this since you've figured out how to patch it; let's see if someone else complains in the future. Worth noting that lodash 4.17.21 was released two years ago and no one else had been complaining about this, so there's probably something wrong during your installation process.

@Josh-Cena Josh-Cena closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
@Josh-Cena Josh-Cena changed the title unable to start docusaurus Lodash import: cannot find module './fp/_baseConvert' Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external This issue is caused by an external dependency and not Docusaurus.
Projects
None yet
Development

No branches or pull requests

2 participants