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

graphql-editor is not working with vitest #600

Open
ut3hnc opened this issue Mar 22, 2024 · 1 comment
Open

graphql-editor is not working with vitest #600

ut3hnc opened this issue Mar 22, 2024 · 1 comment

Comments

@ut3hnc
Copy link

ut3hnc commented Mar 22, 2024

When running vitest with graphql-editor, receives below error.

SyntaxError: Unexpected token 'export'
 ❯ Object.<anonymous> node_modules/graphql-editor/lib/state/containers/trees/index.js:16:33

Module <project_path>/node_modules/graphql-editor-worker/lib/index.js:1 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "graphql-editor-worker" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.

As a temporary workaround you can try to inline the package by updating your config:

// vitest.config.js
export default {
  test: {
    server: {
      deps: {
        inline: [
          "graphql-editor-worker"
        ]
      }
    }
  }
}

Thanks.

@aexol
Copy link
Contributor

aexol commented Apr 4, 2024

Yeah you are right we do not support anything but webpack now.

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