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.

Webpack error when launching cypress component-test using material-ui Popover or Modal

See original GitHub issue

Current Behavior

Webpack is launching an error (see bellow) when launching cypress component-test on a components using material-ui Popover or Modal. It seems the issue is with @popperjs/core.

Expected Behavior

Webpack should launch without errors.

Steps to Reproduce

  • Create a react app using nx
  • Create a component using material-ui Popover or Modal
  • Add Cypress component-test to react app
  • Create test on component
  • Launch component-test

Example repository : https://github.com/francois-robert/component-test-popperjs-error

Failure Logs

ERROR in ../../node_modules/@popperjs/core/lib/index.js
Module build failed (from ../../node_modules/babel-loader/lib/index.js):
Error: Cannot find module './.config/babel.config'
Require stack:
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\files\configuration.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\files\index.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\index.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\babel-loader\lib\index.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\loader-runner\lib\loadLoader.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\loader-runner\lib\LoaderRunner.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\webpack\lib\NormalModuleFactory.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\webpack\lib\Compiler.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\webpack\lib\webpack.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\webpack\lib\index.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\@nrwl\web\src\utils\config.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\@nrwl\web\src\utils\web.config.js
- C:\Users\franc\Documents\Code\behindthescreen\node_modules\@nrwl\react\plugins\component-testing\index.js
- C:\Users\franc\Documents\Code\behindthescreen\apps\client-web\cypress.config.ts
- C:\Users\franc\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js
- C:\Users\franc\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\require_async_child.js
    at Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Module._resolveFilename (C:\Users\franc\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules\tsconfig-paths\lib\register.js:75:40)
    at Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue (C:\Users\franc\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules\@cspotcode\source-map-support\source-map-support.js:679:30)
    at Function.module_1.default._resolveFilename (C:\Users\franc\AppData\Local\Cypress\Cache\10.3.1\Cypress\resources\app\node_modules\@packages\server\node_modules\@cypress\webpack-dev-server\dist\helpers\sourceRelativeWebpackModules.js:107:16)
    at resolve (internal/modules/cjs/helpers.js:99:19)
    at loadConfig (C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\files\configuration.js:172:5)
    at loadConfig.next (<anonymous>)
    at mergeExtendsChain (C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\config-chain.js:387:45)
    at mergeExtendsChain.next (<anonymous>)
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\config-chain.js:373:20
    at Generator.next (<anonymous>)
    at loadFileChain (C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\config-chain.js:232:24)
    at loadFileChain.next (<anonymous>)
    at buildRootChain (C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\config-chain.js:135:31)
    at buildRootChain.next (<anonymous>)
    at loadPrivatePartialConfig (C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\partial.js:103:62)
    at loadPrivatePartialConfig.next (<anonymous>)
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\config\partial.js:149:25
    at Generator.next (<anonymous>)
    at step (C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:261:32)
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:273:13
    at async.call.result.err.err (C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:223:11)
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:189:28
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\@babel\core\lib\gensync-utils\async.js:74:7
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:113:33
    at step (C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:287:14)
    at C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:273:13
    at async.call.result.err.err (C:\Users\franc\Documents\Code\behindthescreen\node_modules\gensync\index.js:223:11)

webpack 5.65.0 compiled with 1 error in 19708 ms

Environment

This is nx report for my project, not for the example github repo.

$ nx report

 >  NX   Report complete - copy this into the issue template

   Node : 14.18.0
   OS   : win32 x64
   npm  : 6.14.15

   nx : 14.5.4
   @nrwl/angular : Not Found
   @nrwl/cypress : 14.5.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.5.4
   @nrwl/eslint-plugin-nx : 14.5.4
   @nrwl/express : 14.5.4
   @nrwl/jest : 14.5.4
   @nrwl/js : 14.5.4
   @nrwl/linter : 14.5.4
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : 14.5.4
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.5.4
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.5.4
   @nrwl/web : 14.5.4
   @nrwl/workspace : 14.5.4
   typescript : 4.4.4
   ---------------------------------------
   Community plugins:

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
francois-robertcommented, Sep 20, 2022

Issue is solved with lastest version (14.7.6).

Thanks @barbados-clemens

0reactions
francois-robertcommented, Sep 12, 2022

Hello @barbados-clemens Sorry I took a few days off.

I’ve juste updated the repo (https://github.com/francois-robert/component-test-popperjs-error) with 14.7.4 and had the same error. The changes have been pushed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack error when launching cypress component-test using ...
Webpack is launching an error (see bellow) when launching cypress component-test on a components using material-ui Popover or Modal.
Read more >
makeStyles() crashes in cypress test suite with sheetManager ...
Running multiple component tests in Cypress triggers the following error in the test runner's console, causing tests to fail.
Read more >
How do I use cypress with components that are prefetched or ...
My Cypress test starts with cy.get('#modal-button').click() but this doesn't load the modal because the modal hasn't finished downloading/ ...
Read more >
@cypress/react - npm
This package allows you to use Cypress test runner to unit test your React components with zero effort. Here is a typical component...
Read more >
import vue from 'vue' error | The AI Search Engine You Control
NOTE: I can import the TS vue component into another TS file, i.e., App.vue into example.ts. What is actually happening? During webpack build:...
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