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.

module error in VS Code

See original GitHub issue

Hi,

I get this error in Visual Studio Code when compiling during testing with an Ionic 4 app (with Angular) The database and entry are created fine though. idb version 4.0.0

[ng] ERROR in node_modules/idb/build/esm/entry.d.ts(375,13): error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'. [ng] node_modules/idb/build/esm/entry.d.ts(375,31): error TS2304: Cannot find name 'AsyncIterableIterator'. [ng] node_modules/idb/build/esm/entry.d.ts(382,98): error TS2304: Cannot find name 'AsyncIterableIterator'. [ng] node_modules/idb/build/esm/entry.d.ts(441,13): error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'. [ng] node_modules/idb/build/esm/entry.d.ts(441,31): error TS2304: Cannot find name 'AsyncIterableIterator'. [ng] node_modules/idb/build/esm/entry.d.ts(450,109): error TS2304: Cannot find name 'AsyncIterableIterator'. [ng] node_modules/idb/build/esm/entry.d.ts(502,13): error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'. [ng] node_modules/idb/build/esm/entry.d.ts(502,31): error TS2304: Cannot find name 'AsyncIterableIterator'. [ng] node_modules/idb/build/esm/entry.d.ts(534,13): error TS2339: Property 'asyncIterator' does not exist on type 'SymbolConstructor'. [ng] node_modules/idb/build/esm/entry.d.ts(534,31): error TS2304: Cannot find name 'AsyncIterableIterator'.

`import { Component } from ‘@angular/core’; import { openDB } from ‘idb’;

@Component({ selector: ‘app-home’, templateUrl: ‘home.page.html’, styleUrls: [‘home.page.scss’], }) export class HomePage {

constructor(){ this.createDB(); }

async createDB() { const db = await openDB(‘IDBtest’, 1, { upgrade(db) { console.log(‘making a new object store’); db.createObjectStore(‘testsettings’, { autoIncrement: true }); } }); await db.put(‘testsettings’, { server: ‘127.0.0.1’ }, 1);
} }`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:21 (8 by maintainers)

github_iconTop GitHub Comments

5reactions
josdujcommented, Jul 16, 2019

Adding esnext.asynciterable to tsconfig worked for me.

{
    "compilerOptions": {
        "lib": [
            "esnext.asynciterable",
            "es2018",
            "dom"
        ],
        ...
    },
    ...
}
2reactions
sgabbcommented, Apr 9, 2019

Hi, maybe the problem depends on the configuration of tsconfig.json and/or the import of the node_modules/@types… I have an Angular project with this tsconfig.json

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "allowSyntheticDefaultImports": true,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "importHelpers": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

In the idb/build/esm/entry.d.ts file I get the errors “Property ‘asyncIterator’ does not exist on type ‘SymbolConstructor’.” and “Cannot find name ‘AsyncIterableIterator’.” probably because it is not finding the correct file where the definitions are. It searches in the …\node_modules\typescript\lib\lib.es2015.iterable.d.ts file, while the idm/lib/entry.ts file correctly search the interfaces in …\node_modules\typescript\lib\lib.esnext.asynciterable.d.ts

How is the correct way to set things in order to work?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found error in VS code despite the fact that I ...
To Solve VSCode ModuleNotFoundError: No module named X Error Make sure you are running from the package folder (not from package/module ) if...
Read more >
Import Errors in Python: No Module Named “Module_Name ...
Import Errors in Python: No Module Named “Module_Name” For VS Code ... This is actually a simple error you can fix in no...
Read more >
Python ModuleNotFoundError in VS Code using Code Runner
Python ModuleNotFoundError in VS Code using Code Runner ; Any module not found. The module name then appears in the quotation marks. ;...
Read more >
Visual Studio Code ModuleNotFoundError: No Module Named
I'm installing Python and VSCode on a new computer, and I remember the process being a ... running python from the command prompt,...
Read more >
Python + VS Code - No module named ' ' occur
Cross check you have installed the module for which error occurred · You can check it using cmd pip3 show selenium i.e. pip3...
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