Skip to content
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

How to run in a browser? #22

Open
omril1 opened this issue Jun 30, 2022 · 1 comment
Open

How to run in a browser? #22

omril1 opened this issue Jun 30, 2022 · 1 comment
Labels
question Further information is requested

Comments

@omril1
Copy link

omril1 commented Jun 30, 2022

I tried consuming this package with webpack (version 4.46.0) in a front-end app, getting 2 different type of errors depending on how I try to import it.

If imported via import Web2Driver from 'web2driver';
Getting an error from webpack:

warning  in /*******/node_modules/web2driver/dist/main.js

Critical dependency: the request of a dependency is an expression

If imported via import Web2Driver from 'web2driver/index';
Getting an error:

WARNING in /*****/node_modules/tsconfig-paths/lib/match-path-sync.js 37:58-76
require.extensions is not supported by webpack. Use a loader instead.

WARNING in /*****/node_modules/tsconfig-paths/lib/match-path-async.js 25:58-76
require.extensions is not supported by webpack. Use a loader instead.

ERROR in /*****/node_modules/web2driver/node_modules/cacheable-lookup/source/index.js
Module not found: Error: Can't resolve 'dns' in '/*****/node_modules/web2driver/node_modules/cacheable-lookup/source'

ERROR in /*****/node_modules/web2driver/node_modules/http2-wrapper/source/index.js
Module not found: Error: Can't resolve 'http2' in '/*****/node_modules/web2driver/node_modules/http2-wrapper/source'

ERROR in /*****/node_modules/web2driver/node_modules/http2-wrapper/source/agent.js
Module not found: Error: Can't resolve 'http2' in '/*****/node_modules/web2driver/node_modules/http2-wrapper/source'

ERROR in /*****/node_modules/web2driver/node_modules/http2-wrapper/source/client-request.js
Module not found: Error: Can't resolve 'http2' in '/*****/node_modules/web2driver/node_modules/http2-wrapper/source'

ERROR in /*****/node_modules/tsconfig-paths/lib/register.js
Module not found: Error: Can't resolve 'module' in '/*****/node_modules/tsconfig-paths/lib'

ERROR in /*****/node_modules/web2driver/node_modules/got/dist/source/core/utils/timed-out.js
Module not found: Error: Can't resolve 'net' in '/*****/node_modules/web2driver/node_modules/got/dist/source/core/utils'
@jlipps
Copy link
Collaborator

jlipps commented Jun 30, 2022

This is how it is imported in Appium Inspector.

So maybe try import {Web2Driver} from 'web2driver' instead?

@KazuCocoa KazuCocoa added the question Further information is requested label Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants