appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
125 stars 24 forks source link

Could not load driver 'mac2' Cannot use import statement outside a module #109

Closed DevByZer0 closed 2 years ago

DevByZer0 commented 2 years ago

Hi guys I get the error in the title when I load Appium 2 with the Mac 2 driver. Can anyone help me with this ? Os: macOs Big Sure

[Appium] Welcome to Appium v2.0.0-beta.23 (REV 96137bc19e68398ebbb7033379df288cd8b9a3f9) [Appium] Attempting to load driver mac2... [Appium] Could not load driver 'mac2', so it will not be available. Error in loading the driver was: Cannot use import statement outside a module [debug] [Appium] /Users/xvc/.appium/appium-mac2-driver/node_modules/appium-mac2-driver/index.js:1 [debug] [Appium] import Mac2Driver from './lib/driver'; [debug] [Appium] ^^^^^^ [debug] [Appium] [debug] [Appium] SyntaxError: Cannot use import statement outside a module [debug] [Appium] at Object.compileFunction (node:vm:352:18) [debug] [Appium] at wrapSafe (node:internal/modules/cjs/loader:1026:15) [debug] [Appium] at Module._compile (node:internal/modules/cjs/loader:1061:27) [debug] [Appium] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10) [debug] [Appium] at Module.load (node:internal/modules/cjs/loader:975:32) [debug] [Appium] at Function.Module._load (node:internal/modules/cjs/loader:822:12) [debug] [Appium] at Module.require (node:internal/modules/cjs/loader:999:19) [debug] [Appium] at require (node:internal/modules/cjs/helpers:102:18) [debug] [Appium] at DriverConfig.require (/opt/homebrew/lib/node_modules/appium/lib/extension-config.js:283:12) [debug] [Appium] at map (/opt/homebrew/lib/node_modules/appium/lib/main.js:138:27) [debug] [Appium] at Array.map () [debug] [Appium] at getActiveDrivers (/opt/homebrew/lib/node_modules/appium/lib/main.js:135:5) [debug] [Appium] at main (/opt/homebrew/lib/node_modules/appium/lib/main.js:270:25) (node:20508) [DEP0128] DeprecationWarning: Invalid 'main' field in '/Users/xvc/.appium/appium-mac2-driver/node_modules/appium-mac2-driver/package.json' of './build/index.js'. Please either fix that or report it to the module author (Use node --trace-deprecation ... to show where the warning was created) [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [Appium] Available drivers: [Appium] - mac2@1.0.0 (automationName 'Mac2') [Appium] Available plugins: [Appium] - images@1.2.3 [Appium] No plugins activated. Use the --use-plugins flag with names of plugins to activate

mykola-mokhnach commented 2 years ago

@DevByZer0 Please try to update the driver to v 1.0.1

DevByZer0 commented 2 years ago

@mykola-mokhnach @jlipps it works, thanks for your help