You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are all your remix dependencies & dev-dependencies using the same version?
Yes
Steps to Reproduce
In an Nx monorepo we are using vanilla-extract to style components that are imported by a handful of Remix applications. When a Remix application has *.css.ts files directly, or imports one via a shared lib/package in the monorepo with a relative import, everything works great. However, if the import is via a path alias (defined in tsconfig), Vite in the vanilla-extract plugin/integration process cannot resolve the path of the import. Furthermore, there is no ability to tell Remix about path aliases so it can pass those on to the vanilla-extract integration.
After some debugging and an investigation, we've found where in vanilla-extract these aliases would need to be introduced: the call to vite.createServer() in packages/integration/src/compiler.ts. Here, there is no ability to pass in a resolve.alias Vite configuration to define aliases. On the Remix side, there's no ability to define these aliases to pass through to vanilla-extract.
In the mean time, we've created a patch in our repo that adds in resolve.alias to the config object passed to vite.createServer(). This patch solves the problem for us in the short term but ideally Remix and/or the integration code in vanilla-extract can support an alias configuration, whether automatic or manual.
Seeing as this would likely need to be an update in both Remix and vanilla-extract, an issue has also been opened in that repo.
Expected Behavior
The expected behavior is that path aliases can be resolved when processing *.css.ts files.
Actual Behavior
Code imported in *.css.ts files via path aliases cannot be resolved, leading to build errors.
The text was updated successfully, but these errors were encountered:
What version of Remix are you using?
1.19.1
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
In an Nx monorepo we are using vanilla-extract to style components that are imported by a handful of Remix applications. When a Remix application has
*.css.ts
files directly, or imports one via a shared lib/package in the monorepo with a relative import, everything works great. However, if the import is via a path alias (defined in tsconfig), Vite in the vanilla-extract plugin/integration process cannot resolve the path of the import. Furthermore, there is no ability to tell Remix about path aliases so it can pass those on to the vanilla-extract integration.We've created a reproduction repo that can highlight the situation.
After some debugging and an investigation, we've found where in vanilla-extract these aliases would need to be introduced: the call to
vite.createServer()
in packages/integration/src/compiler.ts. Here, there is no ability to pass in aresolve.alias
Vite configuration to define aliases. On the Remix side, there's no ability to define these aliases to pass through to vanilla-extract.In the mean time, we've created a patch in our repo that adds in
resolve.alias
to the config object passed tovite.createServer()
. This patch solves the problem for us in the short term but ideally Remix and/or the integration code in vanilla-extract can support an alias configuration, whether automatic or manual.Seeing as this would likely need to be an update in both Remix and vanilla-extract, an issue has also been opened in that repo.
Expected Behavior
The expected behavior is that path aliases can be resolved when processing
*.css.ts
files.Actual Behavior
Code imported in
*.css.ts
files via path aliases cannot be resolved, leading to build errors.The text was updated successfully, but these errors were encountered: