-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
CSS bundling fails without entry.client.tsx
and entry.server.tsx
in a monorepo
#5659
Comments
I can confirm I am having a similar issue in an Nx monorepo using
|
Thank you @mcansh for tackling this! I will give this fix a try locally with |
Just confirming that at least in my instance, your PR resolves the issue. I applied this patch and it works: diff --git a/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundleEntryModulePlugin.js b/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundleEntryModulePlugin.js
index 61b318c..0ba16c6 100644
--- a/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundleEntryModulePlugin.js
+++ b/node_modules/@remix-run/dev/dist/compiler/plugins/cssBundleEntryModulePlugin.js
@@ -47,7 +47,7 @@ function cssBundleEntryModulePlugin(config) {
loader: "js",
contents: [
// These need to be exports to avoid tree shaking
- `export * as entryClient from ${JSON.stringify(path__default["default"].relative(config.rootDirectory, config.entryClientFilePath))};`, ...Object.keys(config.routes).map((key, index) => {
+ `export * as entryClient from ${JSON.stringify(path__default["default"].resolve(config.rootDirectory, config.entryClientFilePath))};`, ...Object.keys(config.routes).map((key, index) => {
let route = config.routes[key];
return `export * as route${index} from ${JSON.stringify(`./${route.file}`)};`;
})].join("\n") |
🤖 Hello there, We just published version Thanks! |
I can confirm that this issue is resolved for my case in |
Solved for me too. Awesome. |
What version of Remix are you using?
1.14.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
create-remix
to create a new project in the monorepounstable_vanillaExtract
orunstable_cssModules
app/entry.client.tsx
andapp/entry.server.tsx
root.tsx
:remix build
Expected Behavior
The project should build correctly, as it does when
entry.client.tsx
andentry.server.tsx
are present (this is also the appropriate workaround)Actual Behavior
The following error is produced:
I tested with exactly the same package outside of a monorepo, and the error did not occur. So my best guess is that in a monorepo the relative import is failing due to a scoping issue of some kind.
The text was updated successfully, but these errors were encountered: