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

npm complains missing 'https' when run in browser using react #97

Closed
Cheukting opened this issue Jan 10, 2022 · 1 comment · Fixed by #98
Closed

npm complains missing 'https' when run in browser using react #97

Cheukting opened this issue Jan 10, 2022 · 1 comment · Fixed by #98
Labels
triage issue to be triage

Comments

@Cheukting
Copy link
Contributor

install the package using npm

then try adding const TerminusClient = require("@terminusdb/terminusdb-client");

Module not found: Error: Can't resolve 'https' in '/<path_to_my_app>/new-app/node_modules/@terminusdb/terminusdb-client/lib'

@github-actions github-actions bot added the triage issue to be triage label Jan 10, 2022
@Cheukting
Copy link
Contributor Author

After some digging, it is actually the browser is missing the 'https' module in node.js, see https://stackoverflow.com/questions/51087330/angular-6-many-cant-resolve-errors-crypto-fs-http-https-net-path-stream

To fix the issue, we should add this in the package.json:

"browser": {
    "http": false,
    "https":false,
    "net": false,
    "path": false,
    "stream": false,
    "tls": false
}

@Cheukting Cheukting changed the title npm complains missing 'https' are we missing a dependency? npm complains missing 'https' when run in browser using react Jan 11, 2022
Neelterminusdb added a commit that referenced this issue Jan 11, 2022
Adding browser setting in package.json (fix #97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage issue to be triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant