Error while trying to use esbuild postcss plugin
Opened this issue ยท 0 comments
carere commented
Hello, first of all, thx for your work ๐
I got this error with an empty project, while trying to use postcss to compile my tailwind during bundling, like i usually do with vite.
Maybe, you should allow user to use vitejs instead of bundless ?
Best regards,
Here is my vitro config:
// read more at https://vitro.now.sh/docs/config
/** @type {import('@vitro/cli').VitroConfig} */
const postCssPlugin = require('@deanc/esbuild-plugin-postcss')
const postCssConfig = require('design-system/postcss.config.cjs')
module.exports = {
globs: ['./stories/*.vitro.tsx'],
ignore: ['node_modules', '.bundless'],
bundlessConfig: {
plugins: [postCssPlugin(postCssConfig)],
},
}
And here is my postcss config:
module.exports = {
plugins: {
'postcss-import': {},
'tailwindcss/nesting': {},
tailwindcss: {},
autoprefixer: {},
...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
},
}
[bundless] Dependencies changed, running prebundle phase
โ Prebundling modules in '.bundless/web_modules' > vitro-virtual-index.jsx:1:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspect-mode.css'
1 โ import '@vitro/cli/reexports/inspect-mode.css';
โต ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/traverse.js:124:12: note: This error came from the "onResolve" callback registered here
124 โ onResolve({ filter: filter || /()/ }, async (args) => {
โต ~~~~~~~~~
at setup (/home/carere/Projects/portal/node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/traverse.js:124:13)
at handlePlugins (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:694:7)
at Object.buildOrServe (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:923:44)
at /home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1521:17
at new Promise (<anonymous>)
at Object.build (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1520:14)
at Object.build (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1396:51)
at Object.traverseWithEsbuild (/home/carere/Projects/portal/node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/traverse.js:92:25)
at async Object.prebundle (/home/carere/Projects/portal/node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/prebundle.js:20:33)
> vitro-virtual-index.jsx:2:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspector.css'
2 โ import '@vitro/cli/reexports/inspector.css';
โต ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/traverse.js:124:12: note: This error came from the "onResolve" callback registered here
124 โ onResolve({ filter: filter || /()/ }, async (args) => {
โต ~~~~~~~~~
at setup (/home/carere/Projects/portal/node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/traverse.js:124:13)
at handlePlugins (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:694:7)
at Object.buildOrServe (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:923:44)
at /home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1521:17
at new Promise (<anonymous>)
at Object.build (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1520:14)
at Object.build (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1396:51)
at Object.traverseWithEsbuild (/home/carere/Projects/portal/node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/traverse.js:92:25)
at async Object.prebundle (/home/carere/Projects/portal/node_modules/.pnpm/@bundless+cli@0.5.1/node_modules/@bundless/cli/dist/prebundle/prebundle.js:20:33)
โ Error: Build failed with 2 errors:
vitro-virtual-index.jsx:1:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspect-mode.css'
vitro-virtual-index.jsx:2:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspector.css'
could not start the dev server
Cannot prebundle: Build failed with 2 errors:
vitro-virtual-index.jsx:1:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspect-mode.css'
vitro-virtual-index.jsx:2:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspector.css'
Error: Cannot prebundle: Build failed with 2 errors:
vitro-virtual-index.jsx:1:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspect-mode.css'
vitro-virtual-index.jsx:2:7: error: [register-modules] ENOENT: no such file or directory, open '/home/carere/Projects/portal/apps/docs/@vitro/cli/reexports/inspector.css'
at failureErrorWithLog (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1275:15)
at buildResponseToResult (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:964:32)
at /home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:1057:20
at /home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:576:9
at handleIncomingPacket (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:665:9)
at Socket.readFromStdout (/home/carere/Projects/portal/node_modules/.pnpm/esbuild@0.10.2/node_modules/esbuild/lib/main.js:543:7)
at Socket.emit (node:events:527:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)