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

Fix import statement in tests with the latest node-fetch #13

Open
jakubkoci opened this issue Jun 23, 2023 · 1 comment
Open

Fix import statement in tests with the latest node-fetch #13

jakubkoci opened this issue Jun 23, 2023 · 1 comment

Comments

@jakubkoci
Copy link
Collaborator

Dependabot wanted to update node-fetch #8. But there is the following error in the 3.3.1 version. I found it works fine with the version 2.6.11 we currently use. It would be good to figure out how to fix the issue so we're not stuck at that version. Or, we can just wait for the update of the library itself that would fix it.

    /home/runner/work/ssi-trust-registry/ssi-trust-registry/node_modules/node-fetch/src/index.js:9
    import http from 'node:http';
    ^^^^^^

    SyntaxError: Cannot use import statement outside a module

    > 1 | import fetch from 'node-fetch'
        | ^
      2 | import { startServer } from './server'
      3 | import { Server } from 'http'
      4 | import { AddressInfo } from 'net'

      at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1495:14)
      at Object.<anonymous> (src/server.test.ts:1:1)
@rblaine95
Copy link
Collaborator

Potentially relevant documentation - https://github.com/node-fetch/node-fetch/blob/main/docs/v3-UPGRADE-GUIDE.md

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