Replies: 3 comments 5 replies
-
Update: my workaround for now is to apply the diff from #7779 using patch-package. Hoping for some responses there to determine if it's the right longer-term fix or not. |
Beta Was this translation helpful? Give feedback.
-
This is still an issue in 2024, January 19th. The solution by @SteveSuv didn't work as that's how the default config is now. |
Beta Was this translation helpful? Give feedback.
-
Just got hit by this. Oof. No workaround in v2 yet? Seems postcss plugins can't be used beyond what's out of the box atm. |
Beta Was this translation helpful? Give feedback.
-
I'm using
serverModuleFormat: "cjs"
in my Remix config (and not setting"type": "module"
in mypackage.json
) to work around this issue: #7467but now when I run either
remix build
orremix dev
, I get this error:It seems like this ought to be possible, but I'm not sure if there is some config required that I'm not aware of, or if this is just a bug, particularly since it mentions an export that I'm guessing is in the generated result that the
css-file
plugin produces.I'm currently trying to create a failing integration test for this but haven't repro'd it there yet. I've also verified that the issue still appears in my project using Remix 2.1.0, though. I've also been unable to repro the bug in a new project starting from the Indie Stack, which is strange, because the (proprietary) project I'm working on (where I can reliably repro the issue) is very new and not very complicated yet. Basically I started with the Grunge Stack on Remix 1.14.0, added a small amount of initial PoC code (including shadcn/ui), then migrated to Remix v2.
I've been stepping through the relevant code but I haven't yet found anything that meaningfully differs between my project and the minimal-repro projects (other than the presence/absence of the build error). I'd thought perhaps esbuild was being run with
format="esm"
in one project andformat="cjs"
in the other - i.e. perhaps Remix v2 was assumingesm
for thecss-file
plugin specifically - but so far I'm seeing the same esbuild settings between the passing and failing builds.The project where the error occurs has
serverDependenciesToBuild: "all"
, but I've been unable to repro the issue in the minimal project or integration test even with this setting set. So I don't think it's related to issues like this one, despite the similar error message.An equally satisfying outcome here would be a workaround for #7467 that would let me make this project a
"type": "module"
again. 🙂Beta Was this translation helpful? Give feedback.
All reactions