{"record":{"id":"f5dcc0ae32a139d5","repo":"oxc-project/oxc","slug":"could-not-find-the-reuseworker-option-in-path","errorCode":null,"errorMessage":"Could not find the reuseWorker option in ${path}","messagePattern":"Could not find the reuseWorker option in (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"napi/disable-reused-workers.mjs","lineNumber":15,"sourceCode":"import fs from \"node:fs\";\n\nconst REUSED_WORKERS = \"reuseWorker: { size: __asyncWorkPoolSize + __workerPoolSize },\";\nconst DISABLED_REUSED_WORKERS = \"reuseWorker: false,\";\n\nexport function disableReusedWorkers(path) {\n  let data = fs.readFileSync(path, \"utf-8\");\n\n  // The pool is initialized eagerly, but browsers reject its worker URL when a binding is loaded\n  // from a cross-origin CDN because workers must be loaded from the page's origin.\n  if (data.includes(REUSED_WORKERS)) {\n    data = data.replace(REUSED_WORKERS, DISABLED_REUSED_WORKERS);\n    fs.writeFileSync(path, data);\n  } else if (!data.includes(DISABLED_REUSED_WORKERS)) {\n    throw new Error(`Could not find the reuseWorker option in ${path}`);\n  }\n}\n","sourceCodeStart":1,"sourceCodeEnd":18,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/napi/disable-reused-workers.mjs#L1-L18","documentation":"Diagnostic from oxlint's vue/prefer-import-from-vue rule (crates/oxc_linter/src/rules/vue/prefer_import_from_vue.rs). It flags module specifiers `@vue/runtime-dom`, `@vue/runtime-core`, `@vue/reactivity`, and `@vue/shared`, telling you to import the same bindings from the public `vue` package instead. Those four are Vue's internal packages: their layouts change between releases and importing them directly breaks version alignment and tooling assumptions.","triggerScenarios":"Any import declaration (`import { ref } from '@vue/reactivity'`), indirect re-export (`export { computed } from '@vue/runtime-core'`), or star re-export (`export * from '@vue/runtime-dom'`) whose module specifier is one of the four internal packages. The rule ships an auto-fix replacing the specifier with 'vue'. TypeScript definition files (.d.ts) are exempt, and `@vue/composition-api` (the Vue 2 plugin) is not flagged.","commonSituations":"Copy-pasting from Vue internals or internals-based blog posts; code written against Vue 2's @vue/composition-api that kept deep paths after upgrading; attempts to shrink bundles with deep imports; test utilities reaching into runtime internals.","solutions":["Change the module specifier to 'vue' (run `oxlint --fix` to autofix all occurrences at once).","Verify each named binding actually exists on the public 'vue' entry; replace or remove it if not.","If internals are genuinely required, pin the Vue version and scope an oxlint-disable comment to that single import."],"exampleFix":"// before\nimport { createApp } from '@vue/runtime-dom'\nimport { ref } from '@vue/reactivity'\n\n// after\nimport { createApp, ref } from 'vue'","handlingStrategy":"validation","validationCode":"// reject internal @vue/* specifiers before they reach review\nconst BAD = ['@vue/runtime-dom', '@vue/runtime-core', '@vue/reactivity', '@vue/shared'];\nconst fs = require('fs');\nfor (const f of jsFiles) {\n  const src = fs.readFileSync(f, 'utf8');\n  for (const m of BAD) {\n    if (src.includes(`from '${m}'`) || src.includes(`from \"${m}\"`)) {\n      throw new Error(`${f}: import from 'vue' instead of ${m}`);\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat @vue/runtime-*, @vue/reactivity, and @vue/shared as private implementation details; always import from 'vue'.","Enable the vue plugin in your oxlint config so vue/prefer-import-from-vue runs by default.","Run `oxlint --fix` in CI to auto-rewrite stray deep imports.","When copying Vue internals snippets, rewrite the import specifier first."],"tags":["vue","oxlint","lint","imports","deep-import","autofix"],"backgroundTag":"vue-deep-import","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}