Skip to content

Error 2304 ("Cannot find name...") but only with tide. #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jan 26, 2018 · 4 comments
Closed

Error 2304 ("Cannot find name...") but only with tide. #233

ghost opened this issue Jan 26, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 26, 2018

Hi!

Thanks for such a great project but I've hit a snag. I'm not sure that this is actually a problem with tide though I'm only seeing this problem within the IDE, not at the command line with tsc.

I have a Typescript project that is compiling nicely through tide/tsserver integration. Except for one file where I am making use of Proxy. Tide reports an error in Emacs as Cannot find name "Proxy". [2304].

At the command line I can successfully run the following (build/test.js is generated without errors):

tsc --target 'es2017' --module 'commonjs' --lib 'es2017' --outDir build ./src/test.ts

However tide reports Cannot find name "Proxy". [2304]. The tsconfig.json I'm using:

{
    "compileOnSave": true,
    "compilerOptions": {
        "target": "es2017",
        "module": "commonjs",
        "outDir": "build",
        "lib": [
            "es2017"
        ]
    },

    "include": [
        "src/**/*"
    ]
}

I also checked the tsserver log (I enabled TSS_LOG) and see that the above tsconfig.json is being referenced. The relevant output from that log that's generating an error is:

 {"command":"semanticDiagnosticsSync","seq":"403","arguments":{"file":"/.../test.ts"}}
...
{"seq":0,"type":"response","command":"semanticDiagnosticsSync","request_seq":"403","success":true,"body":[{"start":{"line":1,"offset":18},"end":{"line":1,"offset":23},"text":"Cannot find name 'Proxy'.","code":2304,"category":"error"}]}

I understand that this may be a question for https://github.com/Microsoft/TypeScript/ but I thought I'd check here first. :)

@josteink
Copy link
Collaborator

Try tsc without any parameters and see if that compiles.

If yes, check your tide settings and if tide and tsc is from the same version of typescript.

@josteink
Copy link
Collaborator

tsc may be global, but tide may use a project-local tsserver etc.

@Rovanion
Copy link

I just ran across this issue when I implemented this wmonk/create-react-app-typescript#122 (comment) ugly fix for an issue in create-react-app-typescript. I had added an alias or path @src and the solution seems to have been to rename it simply to src.

@ananthakumaran
Copy link
Owner

closing this as it seems like an issue somewhere else, reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants