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

import/namespace: Parse errors in imported module '@testing-library/user-event': ',' expected using Vue 2.6.x and @testing-library/vue #1170

Open
andresuchitra opened this issue Sep 22, 2023 · 2 comments
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member

Comments

@andresuchitra
Copy link

Reproduction example

https://codesandbox.io/s/loving-archimedes-vvcdt3

Prerequisites

  1. Setup Vue 2.6.x
  2. Setup @testing-library/vue@5 ->

Expected behavior

No VS code error or import/namespace error appeared

Actual behavior

Error in VSCODE:

Parse errors in imported module '@testing-library/user-event': ',' expected. (6:39)

eslint[import/namespace](https://github.com/import-js/eslint-plugin-import/blob/v2.26.0/docs/rules/namespace.md)

User-event version

14.5.1

Environment

Testing Library framework: 14.5.1

JS framework: vue@2.6.14, nuxt@2.15.8

Test environment: "jest": "27.4.5"

JS DOM:

"@testing-library/dom": "^9.3.3",
"@testing-library/jest-dom": "5.16.2",

Additional context

image

I have vue, nuxt, and @testing-library/vue project, and after running:
yarn add --dev @testing-library/user-event

the setup below works in my test running:

import { userEvent as userEventLib } from "@testing-library/user-event";
//....
//....
const userEvent = userEventLib.setup(); // works

However, I can't do build / run the dev due to error in the title above. I'm using VSCODE.
But I can successfully run and simulate the userEvent.paste() call.

Please help how to fix the import error.

Thanks!

@andresuchitra andresuchitra added bug Something isn't working needs assessment This needs to be looked at by a team member labels Sep 22, 2023
@hood
Copy link

hood commented Oct 25, 2023

There is something broken in your eslint-plugin-import setup.

@raplemie
Copy link

This seems to be the same root cause than #1161, see #1161 (comment), maybe it will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs assessment This needs to be looked at by a team member
Projects
None yet
Development

No branches or pull requests

3 participants