Refactor plugin import to use Blob URLs#3787
Conversation
|
|
CLA Assistant Lite bot: I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request |
|
View your CI Pipeline Execution ↗ for commit 77e28ea
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const blob = new Blob([moduleAsText], { type: 'application/javascript' }); | ||
| const blobUrl = URL.createObjectURL(blob); | ||
| const { default: plugin } = await import( | ||
| /* @vite-ignore */ blobUrl | ||
| ); |
There was a problem hiding this comment.
Avoid blob URLs for loading local plugins
Local plugins are now imported via Blob URLs (lines 1082–1086), but Node’s ESM loader only supports file:, data: and node: schemes; attempting import(blobUrl) throws ERR_UNSUPPORTED_ESM_URL_SCHEME before any plugin code runs, so loadProjectFromDirectory will fail for every non-HTTP plugin in a Node environment where this function is used. The previous data: import path worked under Node, so this change regresses plugin loading.
Useful? React with 👍 / 👎.
|
sorry, just find out this is a bun issue |
ac6d5af to
fe9aa77
Compare
|
@mtt-artis Do i understand the code correctly as "only changes import behavior for bun" and you tested that it works? |
|
Released as @mtt-artis thanks for the PR! I had to backport this to an old branch. The target branch in this PR already contained an unpublished new version of the inlang SDK. |
Hi 👋
I have the error below with the current implementation
the use of URL.createObjectURL works better in my case
thanks