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

Enabling experimental feature throws Error: Cannot find module 'critters' #34763

Closed
1 task done
M0hammedImran opened this issue Feb 24, 2022 · 2 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template.

Comments

@M0hammedImran
Copy link

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

➜ pnpm run info
> next info

/bin/sh: 1: yarn: not found

    Operating System:
      Platform: linux
      Arch: x64
      Version: #202202110435~1644952300~21.10~96763f1 SMP Tue Feb 15 19:52:40 U
    Binaries:
      Node: 16.14.0
      npm: 8.5.1
      Yarn: N/A
      pnpm: 6.32.1
    Relevant packages:
      next: 12.1.1-canary.2
      react: 17.0.2
      react-dom: 17.0.2

What browser are you using? (if relevant)

firefox

How are you deploying your application? (if relevant)

self hosted via docker on ec2

Describe the Bug

If I turn the experimental feature optimizeCss: true I get the following error

Error: Cannot find module 'critters'
Require stack:
- /home/imran/Work/tacticle-arenas/node_modules/.pnpm/next@12.1.1-canary.2_react-dom@17.0.2+react@17.0.2/node_modules/next/dist/server/render.js
- /home/imran/Work/tacticle-arenas/node_modules/.pnpm/next@12.1.1-canary.2_react-dom@17.0.2+react@17.0.2/node_modules/next/dist/server/next-server.js
- /home/imran/Work/tacticle-arenas/node_modules/.pnpm/next@12.1.1-canary.2_react-dom@17.0.2+react@17.0.2/node_modules/next/dist/server/next.js
- /home/imran/Work/tacticle-arenas/node_modules/.pnpm/next@12.1.1-canary.2_react-dom@17.0.2+react@17.0.2/node_modules/next/dist/server/lib/start-server.js
- /home/imran/Work/tacticle-arenas/node_modules/.pnpm/next@12.1.1-canary.2_react-dom@17.0.2+react@17.0.2/node_modules/next/dist/cli/next-dev.js
- /home/imran/Work/tacticle-arenas/node_modules/.pnpm/next@12.1.1-canary.2_react-dom@17.0.2+react@17.0.2/node_modules/next/dist/bin/next

This is true for both next@canary and next@latest i.e next@12.1.0

Expected Behavior

No errors when enabling the feature.

To Reproduce

  1. Create a fresh next app.
  2. enable the optimiseCss experimental feature.
  3. start the app with next dev.
@M0hammedImran M0hammedImran added the bug Issue was opened via the bug report template. label Feb 24, 2022
@ijjk
Copy link
Member

ijjk commented Feb 24, 2022

Hi, this feature currently requires installing critters manually as a dependency since it is still experimental.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

3 participants