question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`yarn build:client` or `yarn dev` command are failure caused by `Module not found: Error:`

See original GitHub issue

Summary

Module not found: Error occurs when exec yarn build:client or yarn dev.

$ yarn build:client
Module not found: Error: Can't resolve 'C:/Users/username/mdn/yari/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/toConsumableArray' in 'C:\Users\username\mdn\yari\node_modules\dexie\dist\modern'
Did you mean 'toConsumableArray.js'?
BREAKING CHANGE: The request 'C:/Users/username/mdn/yari/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/toConsumableArray' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

Not sure but I assume this error caused by webpack 5 or react-scripts 5.x

URL

N/A

Reproduction steps

  1. git checkout 8f248fb0eae46f0d49c4bb1423dd668a1388408b
  2. delete node_modules
  3. yarn install
  4. yarn build:client or yarn dev

Expected behavior

Success a build without error

Actual behavior

Module not found: Error occurs

Device

Desktop

Browser

Other (specify below)

Browser version

Other version (specify below)

Operating system

Windows 11

Screenshot

N/A

Anything else?

Node version is v16.15.0

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
caugnercommented, May 21, 2022

Glad to hear @yoshinorin! 🎉

1reaction
caugnercommented, May 20, 2022

I think I found a (temporary) solution by recreating the yarn.lock file(s). However, the same error appears after switching to npm (#6322), which suggests that we’re just lucky that yarn accidentally fixes this somehow. 🤔

https://github.com/mdn/yari/runs/6520871772?check_suite_focus=true#step:9:32

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes | Yarn - Package Manager
A list of Yarn's error codes with detailed explanations. ... A package build failed. ... This error is usually caused by a Yarn...
Read more >
Build node.js app using yarn but getting error Command "build ...
If you execute yarn run it will show the list of commands which can be run. Ideally yarn run dev will do the...
Read more >
Dsapce 7 error on yarn start - Google Groups
Dear All,. I am struggling while I am install Dspace 7. When I tried to install front-end faced following error. ... error Command...
Read more >
'bash: yarn: command not found' error - Netlify Support Forums
2:44:59 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn build' versus '' in ...
Read more >
Getting error messages when running yarn commands
It does not seem to matter what yarn command I give, ... Error: Cannot find module '/Users/isaactait/Desktop/Web_Dev/portfolio-site-2.0/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found