Closed Shinelazy2 closed 1 year ago
How to execute:
Comment out wdio.conf.ts:
// tsNodeOpts: {
// project: './test/tsconfig.json',
// transpileOnly: true
// }
Add type to package.json:
"type": "module"
Error during Quasar build:
C:\Users\shine\OneDrive\Documents\workspace\node\mocha\quasar-project\wdio.conf.ts:1
import { readFileSync } from 'fs';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1084:15)
at Module._compile (node:internal/modules/cjs/loader:1119:27)
at Module.m._compile (C:\Users\shine\OneDrive\Documents\workspace\node\mocha\quasar-project\node_modules\ts-node\src\index.ts:1618:23)
at Module.m._compile (C:\Users\shine\OneDrive\Documents\workspace\node\mocha\quasar-project\node_modules\ts-node\src\index.ts:1618:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at require.extensions.<computed> (C:\Users\shine\OneDrive\Documents\workspace\node\mocha\quasar-project\node_modules\ts-node\src\index.ts:1621:12)
at Object.require.extensions.<computed> [as .ts] (C:\Users\shine\OneDrive\Documents\workspace\node\mocha\quasar-project\node_modules\ts-node\src\index.ts:1621:12)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
PS) Is there no other way to test without building? Is it impossible in development mode?
I've not used Quasar before, but this doesn't seem to be an issue specific to the Electron service, rather an ESM issue / query around using Quasar with WDIO - you will likely get more help over in the WDIO forum
You installed the necessary packages with the following command:
And you also installed Electron in the Quasar Framework using the following commands:
However, you encountered a problem during the installation process with the following error message: