-
Type:
Story
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Developer Tools
Use Case
As a... Developer tools engineer
I want... to be able to bundle dependencies that use Node.js "node:" prefixed imports
So that... I can adopt libraries that use this newer syntax and use them in our compass-web bundle
Dev Experience
Currently webpack throws this error when a "node:" style import is used:
Module build failed: UnhandledSchemeError: Reading from "node:process" is not handled by plugins (Unhandled scheme). Webpack supports "data:" and "file:" URIs by default. You may need an additional plugin to handle "node:" URIs. at .../webpack/lib/NormalModule.js:1038:13
Instead we would expect the "alias" system to work and replace the "node:x" module with our own version of "x"
Reproduction
- Navigate into node_modules/mongodb/lib/mongo_client.js
- replace one of the built in modules, say "fs" with "node:fs"
- run npm compile in the packages/compass-web directory
It should fail with the above error
Risks/Unknowns
- Can this be fixed using the plugin system like the error mentions?
- Do we need to reimplement or can we reuse any part of the alias and bundling system for this?
- Is there any community solutions or issues related to this?
Acceptance Criteria
Implementation Requirements
- Verify that a dependency with "node:x" can be bundled by the compass web webpack config
Testing Requirements
- Validate the bundle is generated correctly, if we have built our own plugin look at what validations webpack tests for.