Skip to content
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

Some dependencies not being resolved when using RsBuild #26091

Open
sachaw opened this issue Oct 9, 2024 · 4 comments
Open

Some dependencies not being resolved when using RsBuild #26091

sachaw opened this issue Oct 9, 2024 · 4 comments
Labels
bundler-resolution Issues caused by bundlers not supporting Deno resolution

Comments

@sachaw
Copy link

sachaw commented Oct 9, 2024

Version: Deno 2.0.0

Hi, Take the following RsBuild + SolidJS repo running under Deno:

https://github.com/sachaw/rsbuild-issue

When running deno install, as "nodeModulesDir": "auto" is set, it is populated as follows:

image

As can be seen modules like date-fns are populated at the root level, and hence are located and compile fine under RsBuild.

Now take my next dependency: @dewars/protobufs which is published to JSR:

It is resolved by my IDE (because of the Deno plugin), but is not populated in my node_modules folder, leading RsBuild to fail to resolve it.

Ideally I can eventually ditch the whole node modules folder, so I'm hoping the solution isn't to copy all of my native deno deps under node_modules

@sachaw sachaw changed the title Namespaced dependencies not being resolved when using RsBuild Some dependencies not being resolved when using RsBuild Oct 9, 2024
@marvinhagemeister marvinhagemeister added the bundler-resolution Issues caused by bundlers not supporting Deno resolution label Oct 10, 2024
@marvinhagemeister
Copy link
Contributor

The issue is likely caused by rsbuild not understanding Deno-specific resolution.

@sachaw
Copy link
Author

sachaw commented Oct 15, 2024

Is this not a deno responsibility (nodejs compat) or is this out of scope for some reason?

@marvinhagemeister
Copy link
Contributor

Every bundler has their own resolution code and rspack/rsbuild always expects a dependency to be in the node_modules folder as it assumes that every dependency is an npm dependency. That assumption is not something we can fix on the Deno side.

@hardfist
Copy link

hardfist commented Nov 6, 2024

It seems we(Rspack) can make a rspack plugin which calls deno_resolver to make it work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bundler-resolution Issues caused by bundlers not supporting Deno resolution
Projects
None yet
Development

No branches or pull requests

3 participants