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]: @playwright/test 1.47.0 broken for tsconfig alias imports #32485

Closed
stevensacks opened this issue Sep 6, 2024 · 3 comments
Closed

[Bug]: @playwright/test 1.47.0 broken for tsconfig alias imports #32485

stevensacks opened this issue Sep 6, 2024 · 3 comments

Comments

@stevensacks
Copy link

stevensacks commented Sep 6, 2024

Version

1.47.0

Steps to reproduce

I updated to 1.47.0 and now my playwright tests are complaining:

Error: Cannot find package '~' imported from /Users/me/project/.playwright/e2e/things.spec.ts

It's a remix project and remix uses ~ as the prefix, which is set in the tsconfig.

This was working just fine in the previous version. Something is broken now.

import {expect, test} from '@playwright/test';
import languages from '~/languages';

test('things can be created, updated, and deleted', async ({browser}) => {
  const context = await browser.newContext({
    extraHTTPHeaders: {
      'Accept-Language': 'en',
    },
  });
  await context.clearCookies();
  const page = await context.newPage();
  await page.goto('/things');
  await expect(page).toHaveURL('/things');
  await expect(page).toHaveTitle(languages.en.pages.things.meta.title);
  await expect(page.getByTitle(/Thing/)).toHaveCount(2);

  await context.close();
});

Expected behavior

Expect playwright to honor the tsconfig alias.

Actual behavior

Complains that it can't find a package.

Rolling back to 1.46.1 fixes the issue.

Additional context

No response

Environment

System:
    OS: macOS 14.6.1
    CPU: (12) arm64 Apple M2 Pro
    Memory: 86.02 MB / 16.00 GB
  Binaries:
    Node: 20.17.0 - ~/.nvm/versions/node/v20.17.0/bin/node
    npm: 10.8.3 - ~/.nvm/versions/node/v20.17.0/bin/npm
    bun: 1.0.18 - ~/.bun/bin/bun
  Languages:
    Bash: 3.2.57 - /bin/bash
  npmPackages:
    @playwright/test: 1.47.0 => 1.47.0
@dgozman
Copy link
Contributor

dgozman commented Sep 6, 2024

@stevensacks Could you please share a full repro? We need the project structure, package.json and tsconfig.json at least to make sure we understand your setup.

@nickdbush
Copy link

This looks like a duplicate of #32480, which has a reproduction

@stevensacks
Copy link
Author

Since it’s a duplicate, I’ll close this one.

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

3 participants