Compiler does not compile, because it says I have errors, which I don't

Answered

I am building a react project from the npm drawer in Webstorm. After a git conflict it says I have errors in file I do not:

Errors by webstorm:

Failed to compile.

./src/container/actions.js
Line 1:25: Parse errors in imported module './types': Line 160: Unexpected token

158 | position: GridItemPosition;
159 | layout: Layout;
> 160 | <<<<<<< Updated upstream
| ^
161 | breakpoint: string;
162 | =======
163 | >>>>>>> Stashed changes (160:2) import/no-named-as-default

Search for the keywords to learn more about each error.

 

My file:

export type OnNewItemAction = {
type: typeof ActionTypes.OnNewItem;
position: GridItemPosition;
layout: Layout;
breakpoint: string;
}

 

Obviously I have no errors.


I tried:
- Invalidating cache
- Restarting Webstorm and computer
- Renaming the file

My version: 


WebStorm 2019.3.2
Build #WS-193.6015.40, built on January 21, 2020
Licensed to ####
Subscription is active until October 18, 2020
Runtime version: 11.0.5+10-b520.30 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.3
GC: ParNew, ConcurrentMarkSweep
Memory: 989M
Cores: 12
Registry: ide.windowSystem.autoShowProcessPopup=true, debugger.watches.in.variables=false
Non-Bundled Plugins: com.intellij.lang.jsgraphql, com.jetbrains.plugins.ini4idea, com.microsoft.vso.idea, ru.adelf.idea.dotenv


0
6 comments

There is a possibility that line ending has been changed, or there is some non-visible character inside. Try to type in the function again manually.

Share a sample project (or file) in case the issue is still here. 

0

I tried and it didn't work. Btw, this has happened to me before. I renamed the file and that solved the issue. But if I rename the file to the old name (with the "errors"), the compiler gets confused again.

0

Looks like a cache problem from your description, but you mentioned that invalidating caches did not fix that. 

So, we need a reproducible project to debug that. 

You may also re-import the project (after backing up and removing .idea directory inside) as a general troubleshooting step. 

0

If I can share any more details on this issue, tell me how I can do so. This happened to me twice already and I believe it is going happen again. If I can share any logs, please let me know.

0

1. Make sure the issue is reproducible after re-importing the project. 

2. Make sure it compiles as predictable in command line (without help of IDE) and cannot be compiled in the IDE.

If two of the above are true, please upload sample project to our FTP according to this instructions and share the exact steps to reproduce the issue here in the thread. 

0

I cannot do that anymore, because I needed to start my work day and I checkout the project again and deleted the old one :) But once I have the same issue, I will make sure to do what you told me and notify you in this issue.

0

Please sign in to leave a comment.