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

Issue with importing NPM packages #53

Open
LlanddewiLovesYou opened this issue Sep 1, 2024 · 0 comments
Open

Issue with importing NPM packages #53

LlanddewiLovesYou opened this issue Sep 1, 2024 · 0 comments

Comments

@LlanddewiLovesYou
Copy link

Not sure what I am missing but I am trying to use import syntax which I see in places of your generated code to import puppeteer:

Screenshot 2024-09-01 at 3 10 51 PM

Receiving this error in the popup's console:
Screenshot 2024-09-01 at 3 13 07 PM

And also this error in the terminal:

Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/agent-base/dist'

ERROR in ./node_modules/basic-ftp/dist/Client.js 6:14-28
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/basic-ftp/dist'

ERROR in ./node_modules/basic-ftp/dist/FtpContext.js 4:14-28
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/basic-ftp/dist'

ERROR in ./node_modules/basic-ftp/dist/netUtils.js 4:14-28
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/basic-ftp/dist'

ERROR in ./node_modules/basic-ftp/dist/transfer.js 6:14-28
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/basic-ftp/dist'

ERROR in ./node_modules/cosmiconfig/dist/loaders.js 74:21-42
Module not found: Error: Can't resolve 'typescript' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/cosmiconfig/dist'

ERROR in ./node_modules/cosmiconfig/dist/loaders.js 103:28-48
Module not found: Error: Can't resolve 'typescript' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/cosmiconfig/dist'

ERROR in ./node_modules/http-proxy-agent/dist/index.js 30:25-39
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/http-proxy-agent/dist'

ERROR in ./node_modules/http-proxy-agent/dist/index.js 31:25-39
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/http-proxy-agent/dist'

ERROR in ./node_modules/https-proxy-agent/dist/index.js 30:25-39
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/https-proxy-agent/dist'

ERROR in ./node_modules/https-proxy-agent/dist/index.js 31:25-39
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/https-proxy-agent/dist'

ERROR in ./node_modules/import-fresh/node_modules/resolve-from/index.js 3:15-32
Module not found: Error: Can't resolve 'module' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/import-fresh/node_modules/resolve-from'

ERROR in ./node_modules/pac-proxy-agent/dist/index.js 30:25-39
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/pac-proxy-agent/dist'

ERROR in ./node_modules/pac-proxy-agent/dist/index.js 31:25-39
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/pac-proxy-agent/dist'

ERROR in ./node_modules/pac-resolver/dist/myIpAddress.js 7:30-44
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/pac-resolver/dist'

ERROR in ./node_modules/pac-resolver/dist/util.js 4:14-28
Module not found: Error: Can't resolve 'dns' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/pac-resolver/dist'

ERROR in ./node_modules/socks-proxy-agent/dist/index.js 33:25-39
Module not found: Error: Can't resolve 'dns' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/socks-proxy-agent/dist'

ERROR in ./node_modules/socks-proxy-agent/dist/index.js 34:25-39
Module not found: Error: Can't resolve 'tls' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/socks-proxy-agent/dist'

ERROR in ./node_modules/socks/build/client/socksclient.js 14:12-26
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/socks/build/client'

ERROR in ./node_modules/socks/build/common/helpers.js 8:12-26
Module not found: Error: Can't resolve 'net' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/socks/build/common'

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/CLI.js 7:0-37
Module not found: Error: Can't resolve 'readline' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/@puppeteer/browsers/lib/esm'

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/fileUtil.js 6:0-42
Module not found: Error: Can't resolve 'child_process' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/@puppeteer/browsers/lib/esm'

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/httpUtil.js 31:14-30
export 'urlToHttpOptions' (imported as 'urlToHttpOptions') was not found in 'url' (possible exports: Url, format, parse, resolve, resolveObject)

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/httpUtil.js 39:28-31
export 'URL' (imported as 'URL') was not found in 'url' (possible exports: Url, format, parse, resolve, resolveObject)

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/install.js 7:0-42
Module not found: Error: Can't resolve 'child_process' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/@puppeteer/browsers/lib/esm'

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/launch.js 6:0-41
Module not found: Error: Can't resolve 'child_process' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/@puppeteer/browsers/lib/esm'

ERROR in ./node_modules/@puppeteer/browsers/lib/esm/launch.js 9:0-32
Module not found: Error: Can't resolve 'readline' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/@puppeteer/browsers/lib/esm'

ERROR in ./node_modules/puppeteer-core/lib/esm/puppeteer/node/ScreenRecorder.js 44:0-49
Module not found: Error: Can't resolve 'child_process' in '/Users/idelduca/Projects/kindle-my-recipes-ext/node_modules/puppeteer-core/lib/esm/puppeteer/node'

ERROR in ./node_modules/yargs/lib/platform-shims/esm.mjs 20:14-27
export 'fileURLToPath' (imported as 'fileURLToPath') was not found in 'url' (possible exports: Url, format, parse, resolve, resolveObject)

2024-09-01 15:14:19: webpack compiled```

It claims it can't resolve the package which in turn is causing that cascade. I thought NPM modules were supported with `import` syntax out of the box? What am I doing wrong? Do you need any other info from me? Please advise.
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

No branches or pull requests

1 participant