Royer Adames
Royer Adames

Reputation: 1076

Module parse failed: Unexpected character '�' (1:2) src/node_modules/playwright/bin/PrintDeps.exe

I trying to run a playwright script on my electron-react app but I am getting this error when it gets to the playwright code.

Module parse failed: Unexpected character '�' (1:2)
src/node_modules/playwright/bin/PrintDeps.exe
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
(Source code omitted for this binary file)

Upvotes: 2

Views: 1848

Answers (2)

HardCoreQual
HardCoreQual

Reputation: 391

You can add playwridght in bundledDependencies in package.json

"bundledDependencies": [ "playwright" ],

and connect it's to webpack.config.js using webpack-node-externals

it's permit not add playwright in bundle.js, but save it as external dependency

Upvotes: 0

Royer Adames
Royer Adames

Reputation: 1076

Add this raw-loader to your webpack config

yarn add raw-loader -D

{
    test: /\.exe$/i,
    use: 'raw-loader',
},

Upvotes: 1

Related Questions