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.

Typings errors and can't import modules

See original GitHub issue

Bug, feature request, or proposal:

Get the given error below when i run ng serve in my angular project.

What is the expected behavior?

To start up and serve my app.

What is the current behavior?

I get this error:

ERROR in /Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/@angular/material/dialog/typings/dialog-config.d.ts (22,40): ',' expected.
ERROR in /Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/@angular/material/dialog/typings/dialog-config.d.ts (22,42): Type parameter name cannot be 'any'
ERROR in /Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/@angular/material/dialog/typings/dialog-container.d.ts (36,14): Generic type 'MatDialogConfig<D, any>' requires 2 type argument(s).
ERROR in /Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/@angular/material/dialog/typings/dialog.d.ts (50,15): ',' expected.
ERROR in /Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/@angular/material/dialog/typings/dialog.d.ts (50,17): Type parameter name cannot be 'any'
ERROR in /Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/@angular/material/dialog/typings/dialog.d.ts (50,90): Generic type 'MatDialogConfig<D, any>' requires 2 type argument(s).
ERROR in RangeError: Maximum call stack size exceeded
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31539:33)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31645:38)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31619:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31680:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31645:38)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31619:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31680:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31645:38)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31619:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31680:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31645:38)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31619:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31680:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31645:38)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31619:42)
    at isRelatedTo (/Users/rickardborjesson/Desktop/GreatSigns/angular-src/node_modules/typescript/lib/typescript.js:31680:42)

What are the steps to reproduce?

I could link my repo but not if it’s unnecessary.

What is the use-case or motivation for changing an existing behavior?

I just want to know if this error know or not

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

@angular/cli: 1.4.9 node: 6.11.2 os: darwin x64 @angular/animations: 4.4.6 @angular/cdk: 2.0.0-beta.12-65d3630 @angular/common: 4.4.6 @angular/compiler: 4.4.6 @angular/core: 4.4.6 @angular/forms: 4.4.6 @angular/http: 4.4.6 @angular/material: 2.0.0-beta.12-65d3630 @angular/platform-browser: 4.4.6 @angular/platform-browser-dynamic: 4.4.6 @angular/router: 4.4.6 @angular/cli: 1.4.9 @angular/compiler-cli: 4.4.6 typescript: 2.2.2

Is there anything else we should know?

Im not using the the material Dialog. I just noticed that I get this error message: node_modules/@angular/material/material"' has no exported member 'MdProgressSpinnerModule'. when i try to import modules in my app.module.ts file:

app.module.ts

...
import { MdButtonModule, 
        MdSlideToggleModule, 
        MdRadioModule, 
        MdProgressSpinnerModule, 
        MdCheckboxModule } from '@angular/material';
...

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ghostcommented, Jan 3, 2018

Update all @angular dependencies to 5.1.2 and typescript to 2.4.0

"dependencies": {
    "@angular/animations": "^5.1.2",
    "@angular/cdk": "^5.0.3",
    "@angular/common": "^5.1.2",
    "@angular/compiler": "^5.1.2",
    "@angular/core": "^5.1.2",
    "@angular/forms": "^5.1.2",
    "@angular/http": "^5.1.2",
    "@angular/material": "^5.0.3",
    "@angular/platform-browser": "^5.1.2",
    "@angular/platform-browser-dynamic": "^5.1.2",
    "@angular/router": "^5.1.2",
    "axios": "^0.17.1",
    "body-parser": "^1.18.2",
    "core-js": "^2.5.3",
    "express": "^4.16.2",
    "node-sass": "^4.7.2",
    "nodemon": "^1.14.7",
    "q": "^1.5.1",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.6.3",
    "@angular/compiler-cli": "^5.1.2",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.5.0",
    "typescript": "~2.4.0"
  }

This fixed my issues for me, remember and run rm-rf /node_modules && npm i to delete your node_modules and then install with latest

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS errors while importing modules in files of shared directory
I have a problem with using npm @types typings in shared directory to ... shared/Test.tsx (1,24): error TS2307: Cannot find module 'react'.
Read more >
Common TypeScript module problems and how to solve them
Solution 1: Locate the correct directory ; "compilerOptions": ; "baseUrl": ; ".", ; "paths": ; "express": ...
Read more >
Cannot use import statement outside a module [React ...
This error mainly occurs when you use the import keyword to import a module in Node.js. Or when you omit the type="module" attribute...
Read more >
Type Errors - Pyre
The above fails to type-check because Pyre cannot guarantee that ... Most basic types are imported from the typing module or are already...
Read more >
Documentation - Module Resolution - TypeScript
In this case, the error would be something like error TS2307: Cannot find module 'moduleA'. Relative vs. Non-relative module imports. Module imports are ......
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