Undici v6 imported by @nuxt/scripts since v1.3.4
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- node.js, nuxtjs, typescript
Research direction
Start by reviewing the @nuxt/scripts dependency setup and related PRs #860 and #870 to determine where Undici v6 is still brought in. Confirm that the dependency is removed without breaking @nuxt/scripts, and verify that a production Nuxt server can use Undici v8 without the interceptors.cache error.
Written by the indexing model from the issue text.
Description
Undici v6 is imported by @nuxt/scripts since v1.3.4 at least up to v1.3.8.
In our case, it conflicts in some hidden way with our own import of undici v8, causing our nitro plugin for enabling the cache (inexistent in v6) to fail, failing our startup, but only on actual servers, not in dev mode.
import { setGlobalDispatcher, Agent, interceptors } from 'undici';
export default defineNitroPlugin(() => {
setGlobalDispatcher(new Agent().compose(interceptors.cache()));
});
=>
Application has thrown an uncaught exception and is terminated:
TypeError: interceptors.cache is not a function
at file:///D:/frontend/server/chunks/_/nitro.mjs:8221:18
at runNitroPlugins (file:///D:/XVRT/frontend/server/chunks/_/nitro.mjs:18122:7)
at file:///D:/frontend/server/chunks/_/nitro.mjs:18133:1
at ModuleJob.run (node:internal/modules/esm/module_job:439:25)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
at async node:internal/modules/esm/loader:643:26
Workaround: add a package override to force undici v8 to be picked-up.
It seems a few PR have been done to cease bringing Undici through @nuxt/scripts, like #860 and #870. Is it possible to remove it entirely from @nuxt/scripts?
(I have tried a repro on Stackblitz, but I have been unable to repro on it or on a dev workstation.)
- Dominant language
- TypeScript
- Stars
- 585
- Forks
- 95
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 42
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nuxt/scripts
-
harlan-agent-ready-to-spec
Difficulty 5/5 Over a week Newbie friendliness 25/100
nuxt/scripts#949 · 1 comment ·
Maintainers usually reply within 1 day
-
Loading 3rd party scripts for unused widgetMay be free again A pull request for this issue was closed without being merged. Openharlan-agent-wait-to-implement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
nuxt/scripts#882 · 1 comment ·
Maintainers usually reply within 1 day
-
harlan-agent-wait-to-implement
Difficulty 5/5 Over a week Newbie friendliness 25/100
nuxt/scripts#881 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 4/5 3-5 days Newbie friendliness 10/100
Maintainers usually reply within 1 day
Similar issues
-
area:security documentation effort:S priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
app:web meta:ops
Difficulty 2/5 Half a day Newbie friendliness 78/100
osu-tournament-rating/otr#1113 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
typegoose/mongodb-memory-server#1040 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 92/100