When I try to run my localhost using yarn dev
it shows this error:
yarn run v1.22.4 $ next -p 7777 ready - started server on 0.0.0.0:7777, url: http://localhost:7777 TypeError: _jestWorker.Worker is not a constructor at Object.loadWebpackHook (D:\isc-web\isc-front\node_modules\next\dist\server\config-utils.js:67:20) at Object.loadConfig [as default] (D:\isc-web\isc-front\node_modules\next\dist\server\config.js:332:29) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async NextServer.loadConfig (D:\isc-web\isc-front\node_modules\next\dist\server\next.js:112:22) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It was all working fine before I did npm install --save-dev babel-plugin-styled-components
even though I canceled the changes by using git checkout -- .
but still got the same problem
If you cancelled dependency changes with git checkout
your node_modules
may still have the old dependencies installed. Try running npm i
again to see if getting updated dependencies resolves the issue.
I can't tell much from this error message and I don't know how far along your project is... Have you seen the official Next.js + styled-components
example? https://github.com/vercel/next.js/tree/canary/examples/with-styled-components
Perhaps if you try setting up the library this way instead?