Skip to content

Error running tests: SyntaxError: Cannot use import statement outside a module #1

@eatrocks

Description

@eatrocks

I get an error running the tests...
SyntaxError: Cannot use import statement outside a module

Steps to reproduce:

  • clone the repository
  • cd into the project directory and run npm i
  • run npm run test

I also get an error trying to do the following in Node, which I believe is possibly related...

  • Using Node 18 LTS create a simple project and
  • run "npm i comet-js-sdk"
  • create a file with the "js" extension
  • import the library like this... import comet from "comet-js-sdk"; or import { CometServer } from "comet-js-sdk";
  • run the file with node
    The error is
    Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/path/to/my-project/node_modules/comet-js-sdk/dist/mjs/lib/output' imported from /path/to/my-project/node_modules/comet-js-sdk/dist/mjs/index.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions