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

Get Webpack Compilation Error on nextjs test with component-level css #9690

Closed
yrue opened this issue Oct 11, 2020 · 4 comments
Closed

Get Webpack Compilation Error on nextjs test with component-level css #9690

yrue opened this issue Oct 11, 2020 · 4 comments
Labels
npm: @cypress/react @cypress/react package issues stale no activity on this issue for a long period

Comments

@yrue
Copy link

yrue commented Oct 11, 2020

Hi,

We have a nextjs project and using component-level css. I tried with the nextjs sample and it works. But it got error as below when importing import styles from './<component>.module.scss';. Looks mini-css-extract-plugin issue and the log similar to nrwl/nx#2174. Any idea?

Error: Webpack Compilation Error
./components/Search.module.scss
Module build failed (from /Users/eur/Desktop/dev_uba/cypress-react-unit-test/node_modules/@zeit/next-css/node_modules/mini-css-extract-plugin/dist/loader.js):
TypeError: this[MODULE_TYPE] is not a function
 @ ./components/Search.jsx 5:0-42
 @ ./cypress/components/Search.spec.jsx

Reproduce
repo: https://github.com/yrue/cypress-react-unit-test/tree/issue

  1. add "nodeVersion": "system" to cypress.json
  2. add scss file cypress-react-unit-test/examples/nextjs/components/Search.module.scss
  3. add import styles from './Search.module.scss'; to cypress-react-unit-test/examples/nextjs/components/Search.jsx
  4. run npm test and got error
@yrue yrue changed the title test failed on nextjs test with component-level css Tests failed on nextjs test with component-level css Oct 11, 2020
@yrue yrue changed the title Tests failed on nextjs test with component-level css Get Webpack Compilation Error on nextjs test with component-level css Oct 20, 2020
@lmiller1990 lmiller1990 transferred this issue from cypress-io/cypress-react-unit-test Dec 11, 2020
@lmiller1990 lmiller1990 added the npm: @cypress/react @cypress/react package issues label Dec 11, 2020
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label May 17, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2023
@testplop
Copy link

testplop commented Jun 5, 2023

Still a issue

@nagash77
Copy link
Contributor

nagash77 commented Jun 5, 2023

Hi @testplop please open a new issue with a reproducible example and the Cypress team will be happy to investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm: @cypress/react @cypress/react package issues stale no activity on this issue for a long period
Projects
None yet
Development

No branches or pull requests

5 participants