question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vue GlobalComponents cause use @types/node Blob instead of dom Blob?

See original GitHub issue

No idea why @types/node got injected.

pnpm 6.32.1, monorepo

➜ npm run lint:vuetsc

> @adtalos/dashboard@0.0.0 lint:vuetsc
> vue-tsc --noEmit

src/components/dynamic_material/download.ts:39:37 - error TS2551: Property 'pipeTo' does not exist on type 'ReadableStream'. Did you mean 'pipe'?

39   await new Blob([buffer]).stream().pipeTo(writable);
                                       ~~~~~~

  ../node_modules/.pnpm/@types+node@17.0.21/node_modules/@types/node/globals.d.ts:197:9
    197         pipe<T extends WritableStream>(destination: T, options?: { end?: boolean | undefined; }): T;
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    'pipe' is declared here.


Found 1 error.

tsconfig.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "lib": ["esnext", "dom"],
    "types": ["vite/client", "wicg-file-system-access", "unplugin-icons/types/vue"],
    "baseUrl": "./"
    }
  },
  "include": [
    ".eslintrc.js",
    "*.js",
    "**/*.ts",
    "**/*.vue"
  ]
}

…/tsconfig.json

{
    "compilerOptions": {
    "types": [],
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "skipLibCheck": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
xiaoxiangmoecommented, Feb 28, 2022

This is not volar’s bug

element-plus/lib/index.d.ts export * from 'element-plus/es/components';

element-plus/es/components/index.d.ts export * from './upload';

element-plus/lib/components/upload/index.d.ts /// <reference types="node" />

You should create a issue in element-plus and tell them to remove all /// <reference types="node" /> in packages

0reactions
exherbcommented, Feb 28, 2022
// NOTE: workaround for https://github.com/element-plus/element-plus/issues/6338
interface Blob {
  stream(): ReadableStream;
}

declare let Blob: {
  new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
};

workaround, if anyone enccounter this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue 3 - "Failed to resolve component" with global components
To register components globally, use app.component in your top-level code: main.js import { createApp } from 'vue'; import App from '.
Read more >
Components Basics - Vue.js
Components allow us to split the UI into independent and reusable pieces, and think about each piece in isolation. It's common for an...
Read more >
Testing Vue.js components with Vue Test Utils - LogRocket Blog
This guide showcases the benefits of testing your Vue.js components using Vue Test Utils and includes some real-world examples.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found