Trying to build a next.js app in Docker and am running into autoprefixer not being found
Unanswered
Northeast Congo Lion posted this in #help-forum
Northeast Congo LionOP
Hey,
I'm trying to build [this app](https://github.com/tigrisdata-community/multi-modal-starter-kit) with Docker. When it builds, I get this error:
Autoprefixer is in the dependency tree:
but for some reason I just keep running into this error when trying to build.
What am I doing wrong?
I'm trying to build [this app](https://github.com/tigrisdata-community/multi-modal-starter-kit) with Docker. When it builds, I get this error:
Error: Cannot find module 'autoprefixer'
Require stack:
- /app/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js
- /app/node_modules/next/dist/build/webpack/config/blocks/css/index.js
- /app/node_modules/next/dist/build/webpack/config/index.js
- /app/node_modules/next/dist/build/webpack-config.js
- /app/node_modules/next/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js
- /app/node_modules/next/dist/build/collect-build-traces.js
- /app/node_modules/next/dist/build/index.js
- /app/node_modules/next/dist/cli/next-build.js
- /app/node_modules/next/dist/lib/commands.js
- /app/node_modules/next/dist/bin/next
at Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
at /app/node_modules/next/dist/server/require-hook.js:55:36
at Function.resolve (node:internal/modules/helpers:190:19)
at loadPlugin (/app/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:49:32)
at /app/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:56
at Array.map (<anonymous>)
at getPostCssPlugins (/app/node_modules/next/dist/build/webpack/config/blocks/css/plugins.js:157:47)
at async /app/node_modules/next/dist/build/webpack/config/blocks/css/index.js:124:36
at async /app/node_modules/next/dist/build/webpack/loaders/next-font-loader/index.js:86:33
at async Span.traceAsyncFn (/app/node_modules/next/dist/trace/trace.js:151:20)s
Autoprefixer is in the dependency tree:
$ stat ./node_modules/autoprefixer
File: ./node_modules/autoprefixer
Size: 4096 Blocks: 8 IO Block: 4096 directory
but for some reason I just keep running into this error when trying to build.
What am I doing wrong?
2 Replies
Komondor
in your dockerfile, are you copying the dependencies into the image?
Komondor
the node modules specifically