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

[BUG]: SyntaxError: Unexpected token 'with' #30473

Closed
nichita-pasecinic opened this issue Apr 23, 2024 · 1 comment · Fixed by #30482
Closed

[BUG]: SyntaxError: Unexpected token 'with' #30473

nichita-pasecinic opened this issue Apr 23, 2024 · 1 comment · Fixed by #30482

Comments

@nichita-pasecinic
Copy link

nichita-pasecinic commented Apr 23, 2024

This is duplicate of #28598 - which was closed with no reason

Version

1.40.1

Steps to reproduce

My test is importing a file that has such an import:

import config from './config.json' with {type: 'json'};

Background: I have a vite x TS x react project. Inside package.json I have explicitly set ESM:

  "type": "module",

Expected behavior

No SyntaxError

Actual behavior

When I run playwright test, I get following error:

> playwright test -c playwright/playwright.config.ts
SyntaxError: Unexpected token 'with'

Additional context

No response

Environment

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 14.48 GB / 31.78 GB
  Binaries:
    Node: 21.5.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.13.1 - ~\AppData\Local\pnpm\pnpm.EXE
  IDEs:
    VSCode: 1.87.2 - C:\Users\NichitaPasecinic\AppData\Local\Programs\Microsoft VS Code\bin\code.CMD
@nichita-pasecinic
Copy link
Author

Good stuff, thanks! 🎉

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

Successfully merging a pull request may close this issue.

1 participant