Skip to content
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

Overload signatures must all be ambient or non-ambient. #61

Open
masonk opened this issue Feb 27, 2017 · 7 comments
Open

Overload signatures must all be ambient or non-ambient. #61

masonk opened this issue Feb 27, 2017 · 7 comments

Comments

@masonk
Copy link

masonk commented Feb 27, 2017

On TS 2.1.4, when I import json-typescript-mapper": "^1.1.1", which depends on reflect-metadata,

I get many errors similar to this one:

node_modules/reflect-metadata/Reflect.ts(157,21): error TS2384: Overload signatures must all be ambient or non-ambient.

This is the same as issue #37, which is closed.
It happens for targets es3, es5, and es6.
It happens for the lowest supported version of reflect-metadata (0.1.3) and the most recent version (0.1.10).

I am not using Angular. This is basically a brand new project, with json-typescript-mapper and its reflect-metadata as the only deps.

I think the issue is that you've defined the es7 parts of Reflect as TypeScript, but there are already ambients for the es6 parts of Reflect in the core lib. One solution (which I haven't yet tried, but will soon), is to compile Reflect to .js and emit the types into .d.ts, where I hope they will merge with the core lib types.

Are you working on this project any more, or did it somehow get folded into core-js?

{	
	"compileOnSave": true,
    "compilerOptions": {
		"target": "es6",
        "module":"commonjs",
        "moduleResolution": "node", //to look up node_modules/@types/**
        // "target": "es6",
		// "module": "es6", // default
        "noImplicitAny": true,
        "removeComments": true,
        "preserveConstEnums": true,
		"sourceMap": true,
        // "jsx": "react",
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        // "strictNullChecks": true, // Off for json-typescript-mapper

        // This must be kept in sync with output.path and resolve.root
        // in dll.webpack.config and dll.webpack.config
		"outDir": "build",
        // "typeRoots" : ["typings", "@types"],
        "baseUrl": "src",
        "paths": {
            "*": [
                "*"
            ]
        }
	},
    "include": [
        "./**/*"
    ]
    //"exclude": [
        // "exclude" property defaults to excluding the 
        // node_modules, bower_components, and jspm_packages 
        // directories when not specified.
    //]
}

PS: Thanks for doing this. This is a neat proposal and I hope it makes it into es7.

@aarondrabeck
Copy link

+1

@leo-bo
Copy link

leo-bo commented Jul 11, 2017

Hi @masonk,

Have you managed to find a solution after all?

@markamccann
Copy link

+1

@rbuckton
Copy link
Owner

core-js has adopted their own implementation of this. I'm still working on the project, though its been low on my priority list as of late.

@rbuckton
Copy link
Owner

@masonk, I think the issue is the following line in your tsconfig.json:

  "include": [
    "./**/*"
  ]

Setting "include" or "exclude" overrides the default behavior for both. As a result, the default "exclude" for node_modules is ignored. Either remove the "include" entry, or add an "exclude": ["node_modules", "bower_components", "jspm_packages"].

@soheilous
Copy link

For my case it was a function called "print"!

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

7 participants