Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(react-typescript-vite): support pnpm dependency resolution and ESM wdio config - #40

Closed
hoanle0126 wants to merge 1 commit into
webdriverio:mainfrom
hoanle0126:fix/react-typescript-vite-pnpm-esm-8
Closed

hoanle0126 wants to merge 1 commit into
webdriverio:mainfrom
hoanle0126:fix/react-typescript-vite-pnpm-esm-8

Conversation

@hoanle0126

Copy link
Copy Markdown

When installing dependencies with pnpm in react-typescript-vite, Vite's dependency pre-bundler does not automatically hoist nested CJS dependencies inside @wdio/browser-runner (such as expect), causing Uncaught SyntaxError: The requested module '.../expect/build/index.js' does not provide an export named 'expect' in the browser runner. In addition, the legacy autoCompileOpts.tsNodeOpts block and moduleResolution: "Node" setting caused ESM/TypeScript resolution errors in a "type": "module" package.

This updates react-typescript-vite/wdio.conf.ts, react-typescript-vite/tsconfig.json, and react-typescript-vite/tsconfig.node.json to:

  • Include @wdio/browser-runner nested CJS dependencies in viteConfig.optimizeDeps.include.
  • Use "moduleResolution": "bundler" in tsconfig.json and tsconfig.node.json.
  • Remove the deprecated autoCompileOpts.tsNodeOpts block and type config as WebdriverIO.Config.

Fixes #8
Fixes #27

@hoanle0126 hoanle0126 closed this Nov 23, 2026
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 this pull request may close these issues.

npm run wdio - throws Must use import to load ES Module: throws [🐛 Bug]: Browser runner throw error if use pnpm to install dependencies.

1 participant