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
Create a monorepo without hoisting (default pnpm workspaces)
Create a package @my-company/a
Install some 3rd party dependencies to the @my-company/a package, say lodash and use it somewhere in code
Create an remix app in monorepo and add the @my-company/a as a dependency ("@my-company/a": "workspace:*")
Add path alias in tsconfig which targets the workspace package:
"paths": {
"~/*": ["./app/*"],
// this somewhoe doesnt work
"@my-company/a": ["../../packages/my-company/a/src"]
},
Try to run (dev) the remix app.
Inspect the build/index.js: All the code from packages/my-company/a/src is bundled. This will result in importing dependencies of the @my-company/a package such as lodash which does not exist in node_modules of remix app
Expected Behavior
If the path aliasing matches a dependency, don't bundle the local package.
So in the end, the remix compiler should not bundle @my-company/a if @my-company/a is defined as a dependency in package.json of the app
Actual Behavior
The remix compiler bundles the monorepo package if path aliasing is used and doesn't respect the package.json dependencies.
What version of Remix are you using?
2.2.0
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
@my-company/a
@my-company/a
package, say lodash and use it somewhere in code@my-company/a
as a dependency ("@my-company/a": "workspace:*"
)packages/my-company/a/src
is bundled. This will result in importing dependencies of the@my-company/a
package such aslodash
which does not exist in node_modules of remix appExpected Behavior
If the path aliasing matches a dependency, don't bundle the local package.
So in the end, the remix compiler should not bundle
@my-company/a
if@my-company/a
is defined as a dependency in package.json of the appActual Behavior
The remix compiler bundles the monorepo package if path aliasing is used and doesn't respect the package.json dependencies.
related to #1405 and #2412
The text was updated successfully, but these errors were encountered: