-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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] When using baseUrl, "Rollup failed to resolve import" #27993
Comments
@jacobweber You have to configure vite aliases separately from |
@jacobweber Yeah, this documentation is about e2e tests. We should improve our components documentation for sure! |
Coming from a remix app that aliases the use: {
ctViteConfig: {
resolve: {
alias: {
'~': resolve(__dirname, './app'),
},
},
},
}, |
@atsolberg Could you please share where you placed these configurations to make Playwright work? I'm having trouble configuring Playwright in my React project, which is a pure React setup without using any template.
In my project, I will import files that inside import SomeComponent from '@/components/SomeComponent'; Thus, I create an // vite.config.js
import { resolve } from 'path';
import { defineConfig } from '@playwright/experimental-ct-react';
export default defineConfig({
use: {
ctViteConfig: {
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
},
},
}); However, even after executing |
Regarding your last post @SDxBacon ... a couple of things:
e.g. |
System info
Source code
Test file (self-contained)
my-vite-app.tar.gz
Steps
"baseUrl": "./src"
intsconfig.json
.App.spec.ts
, which includes aimport App from 'App';
npm run test-ct
.Expected
Test runs successfully.
Actual
Exception:
The text was updated successfully, but these errors were encountered: