score:0
turn off typescript language service in settings > language & frameworks > typescript . then turn it back on. this solved it for me.
score:3
unchecking recompile on changes in settings > language & frameworks > typescript > typescript language service solved the issue, albeit the underlying cause remains unknown.
score:3
when i had this problem in webstorm 2019.3.1 i was able to resolve it by going to file > invalidate caches / restart... and pressing the "invalidate and restart" button. when webstorm restarted the error was gone.
score:50
update 11/05/2020:
closing and reopening the file fixes it as well. it seems intellij typescript parsing can get out of sync.
original answer
i might be a little late to the party, but i also experienced this and what fixed it for me were the following steps.
- create a new file.
- copy the contents of the old file to the new file.
- delete the old file.
- rename the new file to match the old file's name.
now i'm not exactly sure why that fixes the issue, but i have a few guesses. i'm using intellij, which is i assume what you're using too since i've never had this issue elsewhere, and ts compiles just fine even with the issue present. it's more of an in-editor-error kind of deal (for me at least). reopening the editor may fix this as well.
hope this all helps!
guess 1
guess 2
Source: stackoverflow.com
Related Query
- TS1128: Declaration or statement expected (end of file)
- Expected to return a value at the end of arrow function with if statement
- React export declaration statement expected
- React Component: Declaration or statement expected ts(1128)
- Declaration or statement expected when exporting
- TypeScript Error: (TS1128) Declaration or statement expected
- Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type
- Could not find a declaration file for module 'react-redux'.
- Could not find declaration file for enzyme-adapter-react-16?
- How to use a module when it could not find a declaration file
- Error: "Could not find a declaration file for module 'react-search-input'"
- Typescript declaration file created with alias instead of relative path
- Expression Expected in React using Switch Statement
- Could not find a declaration file for module 'react-dom'
- Trying to fix "Could not find a declaration file for module" from aws-appsync lib cause another error
- Expected to return a value at the end of this function array-callback-return in React JS
- Upload component not behaving as expected when supplied with the default file list
- Could not find a declaration file for module 'react-split'
- Grid flex end not acting the way I expected
- getting error : Could not find a declaration file for module 'react-bootstrap-modal'. in react js
- Could not find a declaration file for module 'react/jsx-runtime'
- Could not find a declaration file for module 'react-slick'
- Could not find a declaration file for module 'gatsby-plugin-dark-mode'
- React/node build error. Could not find a declaration file for module 'history'. 'node_modules/history/index.js' implicitly has an 'any' type
- Could not find a declaration file for module 'tailwind-scrollbar'
- Could not find a declaration file for module in React Js
- Turn off eslint warning: Newline required at end of file but not found. (eol-last)
- Expected to return a value at the end of arrow function array-callback-return on filter function
- unexpected token, expected "," inside of react render() function in the return statement
- Firebase Storage: Invalid argument in `put` Expected Blob or File
More Query from same tag
- How can I functionally autofill props for a React Component?
- My React app only routes to http://localhost:4002/api/v1/... api bakend
- REACT JS - Working on eshop-like project, got stuck with product filters
- Update an specific value inside the state with the reducer
- bundle.js still contains arrow function and default parameters after using babel pollyfill
- Is there any chance to pass query params as like ?id="idValue" in route?
- How can I duplicate menuItems as much as data from rails server
- How do I set typescript types for an AWS amplify GraphQL response in React?
- How dispatch function with Redux-thunk
- CSRF verification failed error with react, axios and DRF
- React Redux using an object in the initialState
- Where to centralize all fetch() requests in React? And accessing context
- how to display "No Data Found" when user type wrong name in input field which is not in API in React
- React multiple checkbox with selected values set
- How can I override css style with className?
- Why is my RXJS epic in an infinite loop on mount but only called once on button click?
- Material-UI <Radio /> with a <Button />-like appearance
- Conflict in React using font-awesome icons
- React-router You cannot push the same route... force History.push / reload component
- React Material UI: Make textfields stay in one row
- Ctx.db.mutation."updateAccepted" is not a function.. Mutation isn't generated by Prisma
- how to use `console.log` so I can debug my code?
- Styling ReactComponent (SVG) with StyledComponents
- React-Heroku Postgress-Addon: GET http://app-name.herokuapp.com/any 503 (Service Unavailable)
- Mobx reaction on sub array change/remove
- RadioGroup Onchange is not firing in React
- Call local API from local client
- Request body different from submitted data
- Attempted import error: './redux/reducers/configureStore' does not contain a default export (imported as 'configureStore')
- Why isn't my Radio button clickable?