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

Error: Cannot find module 'postcss-import'" #135

Open
rmasonhx12 opened this issue Apr 1, 2024 · 2 comments
Open

Error: Cannot find module 'postcss-import'" #135

rmasonhx12 opened this issue Apr 1, 2024 · 2 comments

Comments

@rmasonhx12
Copy link

cloned repo -- did steps to set upstream and forked repo in synch -- yarn, yarn build, yarn dev with following output

Failed to compile
./src/app/globals.css.webpack[javascript/auto]!=!./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[4].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[4].oneOf[12].use[3]!./src/app/globals.css
Error: Cannot find module 'postcss-import'
Require stack:

  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/build/webpack/config/blocks/css/index.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/build/webpack/config/index.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/build/webpack-config.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/server/dev/hot-reloader.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/server/dev/next-dev-server.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/server/next.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/server/lib/render-server.js
  • /Users/rmasonh/Desktop/myProject/carbon-tutorial-nextjs/node_modules/next/dist/compiled/jest-worker/processChild.js
    at Array.map ()
    This error occurred during the build process and can only be dismissed by fixing the error.
@rmasonhx12
Copy link
Author

I was able to correct problem --

  1. yarn add postcss-import --dev
  2. yarn add postcss.config.js
    module.exports = {
    plugins: {
    'postcss-import': {},
    'autoprefixer': {},
    // other plugins specified as key-value pairs
    },
    };
  3. yarn add autoprefixer --dev

restart server -- yarn dev -- Success Compiled

~~ Please update project as clone needs the postcss import and autoprefixer to run.

@rmasonhx12 rmasonhx12 reopened this Apr 1, 2024
@rmasonhx12
Copy link
Author

~~ Please update project as clone needs the postcss import and autoprefixer to run. SEE ABOVE ISSUE WHICH I CLOSED BUT FORGOT TO WAIT FOR RESPONSE -- REOPENED FOR THIS REASON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant