Encountering ESLint error in WebStorm: Parsing issues with imported module

These are the imports causing the issue:

import { HttpClient } from '@angular/common/http';
import { ConfirmationService, MessageService } from "primeng/api";

The error message I encountered is

ESLint: Parse errors in imported module '@angular/common/http': Cannot read property 'name' of undefined (undefined:undefined)(import/namespace)

and

ESLint: Parse errors in imported module 'primeng/api': Cannot read property 'name' of undefined (undefined:undefined)(import/namespace)

This is how my .eslint.json looks like:

{
  // Eslint configuration details here
}

This is my .tsconfig.json:

{
  // TypeScript compiler options here
}

I have tried adjusting the parserOptions without success. While researching online, I could not find a solution. It seems this issue may be specific to WebStorm as it doesn't occur in VSCode.

If more information or screenshots of my WebStorm settings are needed, please let me know. Any assistance on resolving this would be highly appreciated.

Answer №1

Looks like the issue might be related to this specific problem: https://github.com/typescript-eslint/typescript-eslint/issues/1746

To resolve it, consider updating typescript to version 3.8 or reverting typescript-eslint back to 2.23.0.

@Edit I encountered a similar issue and downgrading typescript-eslint helped eliminate the error, although my build script is still causing crashes. It seems we may need to wait for an update from @typescript-eslint/parser

@Edit2 You can also try downgrading these three packages to version 2.23.0 using yarn resolutions:

"@typescript-eslint/eslint-plugin": "2.23.0",
"@typescript-eslint/parser": "2.23.0",
"@typescript-eslint/typescript-estree": "2.23.0"

This solution worked for me after struggling with it for a few days :)

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unable to retrieve image

I want to save a Discord user's profile picture on Replit, but even though it downloads successfully, the image is not displaying. Here is the code I am using: const request = require('request') const fs = require('fs') app.get(&qu ...

refresh polymer components or make an ajax request within a custom element

I've been spending days on this issue with no success! My application relies on cookies for session handling and includes multiple custom elements imported in the header. Some of these elements need to access information from the 'cookie session& ...

Ways to eliminate a character from the final element of an array

Looking to eliminate the final comma from a JavaScript array var arr = ["CCC,","DDD,"]; The desired outcome should be var arr = ["CCC,","DDD"]; Any assistance would be greatly valued... ...

Stop the user from navigating away from the current page if any changes have not been saved, all within React without relying on

My project includes a panel that opens as a modal from right to left. This panel contains a left navigation menu with various options that, when clicked, display different components. These components primarily consist of forms, and my goal is to alert th ...

Creating a global user object accessible to all Angular2 components

Hey there! I've successfully shared the Parent container's property with an attribute directive and inputs, but it's not working when the child component is brought in using <router-outlet>. Any suggestions on how to share it with ever ...

An HTML attribute that evaluates to true if a condition is met

In my ng-repeat, each repeated item contains an input box where autofocus is set. This causes autofocus to be applied to all items, but in iOS, there's a bug that auto focuses on the last input box instead of the first one. To fix this issue, I need ...

An error was discovered: [$injector:unpr] The provider aProvider is not recognized <- a

While working on my development machine, I encountered no issues. However, upon loading the same form onto my production server, I encountered an error: Uncaught Error: [$injector:unpr] Unknown provider: aProvider <- a I found that removing the followi ...

What could be causing the mat-radio button in one card to toggle all other cards as well?

Within my home.component.html file, you will find the following code: <div class="grid grid-cols-5 gap-4 pt-10"> <div *ngFor="let card of cards" class=""> <div *ngIf="card==null;then nil else notnil&q ...

Encountering an internal server error while submitting a Node.js form: stream is not readable

I've encountered an issue while working on a project that involves form submission (Registration and Login). My server is functioning properly and connected to my MongoDB, everything else is working fine, but when trying to submit the form input, an e ...

Troubleshooting React ESLint: Issues with display-name Rule

Has anyone had success with the eslint rules for react (react/display-name)? In my code, I'm not getting any warning if I leave out the displayName. I was expecting to see an eslint warning in this case. For example: Component.jsx import React ...

AngularJS - Influence of Model on Controller leads to Model update

In my Angular application, I am facing an issue with data manipulation. The data is pulled from a model on app load and then modified in a controller's function. However, I only want this additional data to be used for that specific page without savin ...

Having Trouble with Your React.js Rendering?

I'm starting to learn React.js but I'm having trouble rendering it into the HTML. I can't figure out what's wrong. Any help would be greatly appreciated. Below are the HTML and JSX code: (Note: Full links to the react library are incl ...

The MUI persistent drawer navigation bar becomes dysfunctional when accessing a specific route

Exploring the MUI library for the first time, I successfully created a navigation bar that functions properly for one route (Dashboard). However, when attempting to implement it on the candidate route, it collapses as shown in this Screengrab of collapsed ...

Incorporating object into main function of VueJS root component

I have integrated VueJS into my HTML template for an application. When a button is clicked, it passes the object of a component to its root in the following manner: <button v-on:click="$root.savePlan(dataObj)"></button> The dataObj is passe ...

Tips for triggering window load event on a particular page

I need to trigger the windows.load event on a specific page. Currently, I have set it up like this: $(window).load(function(){ if(document.URL == "/car-driving.html") { overlay.show(); overlay.appendTo(document.body); $('.popup' ...

Interact with C client to nodejs server by exchanging messages

I have created a TCP client in C and now I'm exploring the possibility of developing the server side in nodejs to simplify the process and seamlessly integrate it into an existing application... In my C code, message sending and receiving are impleme ...

What is the best way to extract the "id" field from a JSON object using JavaScript?

{ "id": "order_I4rOK0TqFk3nxF", "entity": "order", "amount": 200000, "amount_paid": 0, "amount_due": 200000, "currency": "INR&quo ...

Angularjs search filter performance slows down significantly when handling large datasets

I am currently working on an AngularJS client application that displays data in a table using the dir-paginate directive from dirPagination.js. Here is the code snippet: <input type="text" ng-change="SomeTask()" ng-model="vm.searchKeyword" /> &l ...

assigning state to a React component by utilizing onClick event in a functional component with TypeScript

const Navigation = () => { const [activeItem, setActiveItem] = useState<string>("tasks"); return { <NavigationContainer> <NavItem onClick=(() => setActiveItem("settings")/> ...

One laptop is experiencing unusually sluggish JavaScript performance compared to the rest of the devices in the group

Currently, I am developing a web application that heavily relies on JavaScript. While most computers (all running IE6 unfortunately) have an average document.ready time of about 2 seconds, there is one computer experiencing extremely slow JavaScript execut ...