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

Cannot optimise dependency @aws-amplify/auth #1502

Closed
hmaurer opened this issue Jan 12, 2021 · 1 comment
Closed

Cannot optimise dependency @aws-amplify/auth #1502

hmaurer opened this issue Jan 12, 2021 · 1 comment

Comments

@hmaurer
Copy link

hmaurer commented Jan 12, 2021

Describe the bug

An error occurs during optimisation of the @aws-amplify/auth@3.4.17 package (v3.14.17 is the latest version at the time of writing) .

Reproduction

npm init @vitejs/app
# Project name: the-app
# Select a template: vanilla
cd the-app/
npm i && npm i @aws-amplify/auth@3.4.17 --save
npm run dev

System Info

  • vite version: v2.0.0-beta.23
  • Operating System: MacOS Catalina 10.15.7
  • Node version: v12.18.4
  • Package manager (npm/yarn/pnpm) and version: NPM v6.14.6

Logs (Optional if provided reproduction)

$ npm run dev -- --debug

> the-app@0.0.0 dev /Users/hmaurer/Developer/lab/the-app
> vite "--debug"

  vite:config no config file found. +0ms
  vite:config using resolved config: {
  vite:config   root: '/Users/hmaurer/Developer/lab/the-app',
  vite:config   mode: 'development',
  vite:config   configFile: undefined,
  vite:config   logLevel: undefined,
  vite:config   server: {},
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     server: {}
  vite:config   },
  vite:config   command: 'serve',
  vite:config   isProduction: false,
  vite:config   optimizeCacheDir: '/Users/hmaurer/Developer/lab/the-app/node_modules/.vite',
  vite:config   alias: [
  vite:config     {
  vite:config       find: /^\/@vite\//,
  vite:config       replacement: '/Users/hmaurer/Developer/lab/the-app/node_modules/vite/dist/client/'
  vite:config     }
  vite:config   ],
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'vite:dynamic-import-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html',
  vite:config     'vite:css',
  vite:config     'vite:esbuild',
  vite:config     'vite:json',
  vite:config     'vite:wasm',
  vite:config     'vite:worker',
  vite:config     'vite:asset',
  vite:config     'vite:css-post',
  vite:config     'vite:client-inject',
  vite:config     'vite:import-analysis'
  vite:config   ],
  vite:config   build: {
  vite:config     base: '/',
  vite:config     target: [ 'es2019', 'edge16', 'firefox60', 'chrome61', 'safari11' ],
  vite:config     polyfillDynamicImport: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {},
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: true,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false
  vite:config   },
  vite:config   env: { BASE_URL: '/', MODE: 'development', DEV: true, PROD: false },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   }
  vite:config } +5ms
  vite:resolve 1ms   ./Auth -> null +0ms
  vite:optimize optimizing @aws-amplify/auth (contains relative imports) +0ms
  vite:optimize skipping @aws-amplify/auth (single esm file, doesn't need optimization) +0ms
Optimizable dependencies detected:
@aws-amplify/auth
Pre-bundling them to speed up dev server page load...
(this will be run only when your dependencies or config have changed)
[plugin:vite:resolve] externalized node built-in "crypto" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/hash-node/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "fs" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/util-body-length-node/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "process" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/util-user-agent-node/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "http" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/node-http-handler/dist/es/node-http-handler.js)
[plugin:vite:resolve] externalized node built-in "https" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/node-http-handler/dist/es/node-http-handler.js)
[plugin:vite:resolve] externalized node built-in "child_process" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/credential-provider-process/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "http2" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/node-http-handler/dist/es/node-http2-handler.js)
[plugin:vite:resolve] externalized node built-in "stream" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/node-http-handler/dist/es/stream-collector/collector.js)
[plugin:vite:resolve] externalized node built-in "stream" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/node-http-handler/dist/es/write-request-body.js)
[plugin:vite:resolve] externalized node built-in "fs" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/shared-ini-file-loader/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "os" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/shared-ini-file-loader/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "path" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/shared-ini-file-loader/dist/es/index.js)
[plugin:vite:resolve] externalized node built-in "http" to empty module. (imported by: /Users/hmaurer/Developer/lab/the-app/node_modules/@aws-sdk/credential-provider-imds/dist/es/remoteProvider/httpRequest.js)

Dep optimization failed with error:
(node:98917) UnhandledPromiseRejectionWarning: Error: 'request' is not exported by __browser-external, imported by node_modules/@aws-sdk/credential-provider-imds/dist/es/remoteProvider/httpRequest.js
    at error (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:5265:30)
    at Module.error (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:9858:16)
    at handleMissingExport (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:9747:28)
    at Module.traceVariable (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:10251:24)
    at ModuleScope.findVariable (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:8770:39)
    at FunctionScope.findVariable (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:2782:38)
    at ChildScope.findVariable (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:2782:38)
    at FunctionScope.findVariable (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:2782:38)
    at ChildScope.findVariable (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:2782:38)
    at Identifier$1.bind (/Users/hmaurer/Developer/lab/the-app/node_modules/rollup/dist/shared/rollup.js:4138:40)
(node:98917) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:98917) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@yyx990803
Copy link
Member

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants