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

Compilation errors when used with TypeScript #56

Closed
mhoangvslev opened this issue Apr 25, 2019 · 2 comments
Closed

Compilation errors when used with TypeScript #56

mhoangvslev opened this issue Apr 25, 2019 · 2 comments

Comments

@mhoangvslev
Copy link
Contributor

mhoangvslev commented Apr 25, 2019

When I use neode with AngularJS:
import { Neode } from 'neode';
gives compilation error
ERROR in src/app/database/database.service.ts(2,10): error TS2724: Module '"../../../node_modules/neode/types"' has no exported member 'Neode'. Did you mean 'Node'?

Fix:
in index.js: change export = Neode to export { Neode }

or

in your script: import * as Neode from 'neode'

Could be duplicate of #14

@mhoangvslev mhoangvslev changed the title Compilation error when Compilation error when used with TypeScript Apr 25, 2019
@mhoangvslev mhoangvslev changed the title Compilation error when used with TypeScript Compilation errors when used with TypeScript Apr 26, 2019
@adam-cowley
Copy link
Owner

The Neode constructor is the default export from the package, not imported inside braces:

import Neode from 'neode';

const graph = new Neode('bolt://localhost:7687', 'username', 'password');

.fromEnv is a static method
const graph = Neode.fromEnv();

@mhoangvslev
Copy link
Contributor Author

import Neode from 'neode';
gives me

ERROR in src/app/database/database.service.ts(2,8): error TS1192: Module '"/home/minhhoangdang/OneDrive/UnivLR/L3/S6/Stage/Cogarius/ArgosJS/node_modules/neode/types/index"' has no default export.

I am using

import * as Neode from 'neode';

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

2 participants