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

Building with plugin-legacy causes "regeneratorRuntime is undefined" error in IE11 #3362

Closed
6 tasks done
joshdura opened this issue May 11, 2021 · 2 comments · Fixed by #3389
Closed
6 tasks done

Building with plugin-legacy causes "regeneratorRuntime is undefined" error in IE11 #3362

joshdura opened this issue May 11, 2021 · 2 comments · Fixed by #3389
Labels
documentation Improvements or additions to documentation plugin: legacy

Comments

@joshdura
Copy link

Describe the bug

When I build my project with @vitejs/plugin-legacy and testing in IE11, I get the following error:

Unhandled promise rejection ReferenceError: 'regeneratorRuntime' is undefined'

Reproduction

Unfortunately due to the complexity of my project I am unable to put together a reproduction for this. Will work on getting that together soon.

System Info

Output of npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers:

npx: installed 1 in 1.178s

  System:
    OS: macOS Mojave 10.14.5
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 2.43 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.5.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 90.0.4430.93
    Firefox: 88.0
    Safari: 13.1.1

Used package manager: yarn

Logs

Joshs-Work-Laptop:dashboard joshdura$ yarn build --debug
yarn run v1.22.10
$ NODE_OPTIONS='--max-old-space-size=8192' echo $NODE_OPTIONS && tsc && vite build --debug

  vite:config bundled config file loaded in 127ms +0ms
[dotenv][DEBUG] did not match key and value when parsing line 1: # ddura: Variables included in local deployments. Note that variables set in the .env
[dotenv][DEBUG] did not match key and value when parsing line 2: # file will override the local environment variables. See config/env.js to see ordering
[dotenv][DEBUG] did not match key and value when parsing line 3: # of how files will be processed/overridden.
[dotenv][DEBUG] did not match key and value when parsing line 4:
[dotenv][DEBUG] did not match key and value when parsing line 5: # For env variables to be included, they must be prefixed with `VITE_`
[dotenv][DEBUG] did not match key and value when parsing line 6:
[dotenv][DEBUG] did not match key and value when parsing line 1: # For env variables to be included, they must be prefixed with `REACT_APP` (see webpack config)
  vite:config using resolved config: {
  vite:config   plugins: [
  vite:config     'alias',
  vite:config     'react-refresh',
  vite:config     'vite:tsconfig-paths',
  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-plugin-package-version',
  vite:config     'legacy-generate-polyfill-chunk',
  vite:config     'legacy-env',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'legacy-post-process',
  vite:config     'vite:import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter'
  vite:config   ],
  vite:config   resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  vite:config   css: { preprocessorOptions: { scss: [Object] } },
  vite:config   publicDir: '/Users/joshdura/Work/graphium-core/packages/dashboard/public',
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: { output: [Array] },
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     brotliSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null
  vite:config   },
  vite:config   define: {
  vite:config     'import.meta.env.PACKAGE_VERSION': '"1.1.334"',
  vite:config     'import.meta.env.LEGACY': '__VITE_IS_LEGACY__'
  vite:config   },
  vite:config   configFile: '/Users/joshdura/Work/graphium-core/packages/dashboard/vite.config.ts',
  vite:config   configFileDependencies: [ 'vite.config.ts' ],
  vite:config   inlineConfig: {
  vite:config     root: undefined,
  vite:config     base: undefined,
  vite:config     mode: undefined,
  vite:config     configFile: undefined,
  vite:config     logLevel: undefined,
  vite:config     clearScreen: undefined,
  vite:config     build: {}
  vite:config   },
  vite:config   root: '/Users/joshdura/Work/graphium-core/packages/dashboard',
  vite:config   base: '/',
  vite:config   cacheDir: '/Users/joshdura/Work/graphium-core/packages/dashboard/node_modules/.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   server: { fsServe: { root: '/Users/joshdura/Work/graphium-core' } },
  vite:config   env: {
  vite:config     VITE_APP_ENV: 'local',
  vite:config     VITE_HEAP_IO: '356948029',
  vite:config     VITE_FLAGSMITH_ENV_ID: 'X4zeUoam9hmqqfMd4VvNMV',
  vite:config     VITE_FLATFILE_KEY: 'de95e550-61ea-48c5-a2d5-114ef9612596',
  vite:config     VITE_APP_VERSION: '',
  vite:config     VITE_APP_NAME: '',
  vite:config     VITE_AUTH0_CLIENT_ID: 'GTkJ6nJgxyjf7T4Rbyn4GsvzzVlUxm2c',
  vite:config     VITE_AUTH0_AUDIENCE: 'emr-services-dev',
  vite:config     VITE_AUTH0_DOMAIN: 'auth.graphiumemr.com',
  vite:config     BASE_URL: '/',
  vite:config     MODE: 'production',
  vite:config     DEV: false,
  vite:config     PROD: true
  vite:config   },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: { esbuildOptions: { keepNames: undefined } }
  vite:config } +11ms
vite v2.3.0 building for production...
transforming (88) src/containers/Facilities/index.tsx  vite:resolve 0ms   ./src/styles/variables.scss -> null +0ms
  vite:resolve 3ms   @fullcalendar/core/main.css -> /Users/joshdura/Work/graphium-core/node_modules/@fullcalendar/core/main.css +0ms
transforming (109) ../../node_modules/yup/es/Lazy.js  vite:resolve 0ms   @fullcalendar/daygrid/main.css -> /Users/joshdura/Work/graphium-core/node_modules/@fullcalendar/daygrid/main.css +226ms
transforming (132) ../../node_modules/lodash-es/mapKeys.js  vite:resolve 0ms   @fullcalendar/timegrid/main.css -> /Users/joshdura/Work/graphium-core/node_modules/@fullcalendar/timegrid/main.css +133ms
transforming (161) src/containers/QcdrSettings/index.tsx  vite:resolve 1ms   typeface-montserrat/index.css -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/index.css +198ms
transforming (271) src/containers/Teams/styles.module.scss  vite:resolve 0ms   ./files/montserrat-latin-100.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-100.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-100italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-100italic.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-200.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-200.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-200italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-200italic.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-300.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-300.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-300italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-300italic.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-400.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-400.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-400italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-400italic.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-500.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-500.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-500italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-500italic.woff2 +0ms
  vite:resolve 1ms   ./files/montserrat-latin-600.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-600.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-600italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-600italic.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-700.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-700.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-700italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-700italic.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-800.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-800.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-800italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-800italic.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-900.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-900.woff2 +0ms
  vite:resolve 2ms   ./files/montserrat-latin-900italic.woff2 -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-900italic.woff2 +0ms
transforming (510) ../../node_modules/lodash-es/_baseIsTypedArray.js  vite:resolve 0ms   ./files/montserrat-latin-100italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-100italic.woff +491ms
  vite:resolve 0ms   ./files/montserrat-latin-200italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-200italic.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-100.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-100.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-200.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-200.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-400italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-400italic.woff +1ms
  vite:resolve 0ms   ./files/montserrat-latin-300italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-300italic.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-300.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-300.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-400.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-400.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-700.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-700.woff +1ms
  vite:resolve 0ms   ./files/montserrat-latin-500italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-500italic.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-600italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-600italic.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-700italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-700italic.woff +1ms
  vite:resolve 0ms   ./files/montserrat-latin-500.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-500.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-600.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-600.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-800.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-800.woff +0ms
  vite:resolve 0ms   ./files/montserrat-latin-900italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-900italic.woff +9ms
  vite:resolve 0ms   ./files/montserrat-latin-800italic.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-800italic.woff +1ms
  vite:resolve 0ms   ./files/montserrat-latin-900.woff -> /Users/joshdura/Work/graphium-core/node_modules/typeface-montserrat/files/montserrat-latin-900.woff +0ms
transforming (2975) src/components/DiscreteForm/inputs/DateTime/index.tsxUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification
 2983 modules transformed.
warnings when minifying css:
Unexpected '}' at 6001:0.
Invalid property name 'input {
        background-color' at 5998:4. Ignoring.
Invalid selector '}

._error_1fzvd_36' at 6001:0. Ignoring.
rendering chunks (2)...[@vitejs/plugin-legacy] legacy polyfills: Set {
  'core-js/es/global-this',
  'core-js/es/promise/index',
  'core-js/modules/es.object.to-string.js',
  'core-js/modules/es.promise.js'
}
  vite:config using resolved config: {
  vite:config   root: '/Users/joshdura/Work/graphium-core/node_modules/@vitejs/plugin-legacy',
  vite:config   configFile: undefined,
  vite:config   logLevel: 'error',
  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     'polyfills',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter'
  vite:config   ],
  vite:config   build: {
  vite:config     target: false,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 4096,
  vite:config     cssCodeSplit: true,
  vite:config     sourcemap: false,
  vite:config     rollupOptions: { input: [Object], output: [Object] },
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     minify: 'terser',
  vite:config     terserOptions: {},
  vite:config     cleanCssOptions: {},
  vite:config     write: false,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: false,
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     brotliSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null
  vite:config   },
  vite:config   configFileDependencies: [],
  vite:config   inlineConfig: {
  vite:config     root: '/Users/joshdura/Work/graphium-core/node_modules/@vitejs/plugin-legacy',
  vite:config     configFile: false,
  vite:config     logLevel: 'error',
  vite:config     plugins: [ [Object] ],
  vite:config     build: {
  vite:config       write: false,
  vite:config       target: false,
  vite:config       minify: 'terser',
  vite:config       assetsDir: 'assets',
  vite:config       rollupOptions: [Object]
  vite:config     }
  vite:config   },
  vite:config   base: '/',
  vite:config   resolve: { dedupe: undefined, alias: [ [Object] ] },
  vite:config   publicDir: '/Users/joshdura/Work/graphium-core/node_modules/@vitejs/plugin-legacy/public',
  vite:config   cacheDir: '/Users/joshdura/Work/graphium-core/node_modules/@vitejs/plugin-legacy/node_modules/.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isProduction: true,
  vite:config   server: { fsServe: { root: '/Users/joshdura/Work/graphium-core' } },
  vite:config   env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  vite:config   assetsInclude: [Function: assetsInclude],
  vite:config   logger: {
  vite:config     hasWarned: false,
  vite:config     info: [Function: info],
  vite:config     warn: [Function: warn],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen]
  vite:config   },
  vite:config   createResolver: [Function: createResolver],
  vite:config   optimizeDeps: { esbuildOptions: { keepNames: undefined } }
  vite:config } +3m
dist/assets/polyfills-legacy.6257809f.js   28.42kb / brotli: 9.97kb
dist/assets/index-legacy.95590f09.js       1698.71kb / brotli: skipped (large chunk)
dist/assets/vendor-legacy.95036688.js      2975.20kb / brotli: skipped (large chunk)

(!) Some chunks are larger than 500kb after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
warnings when minifying css:
Unexpected '}' at 6001:0.
Invalid property name 'input {
        background-color' at 5998:4. Ignoring.
Invalid selector '}

._error_1fzvd_36' at 6001:0. Ignoring.
dist/assets/gh-favicon.1a887d76.ico                     16.56kb
dist/assets/graphium-logo.8cf94da4.svg                  8.80kb
dist/assets/fieldmed-logo.f2cf4f91.svg                  10.24kb
dist/assets/montserrat-latin-100italic.742edbfd.woff2   18.21kb
dist/assets/montserrat-latin-200italic.f4e7e734.woff2   18.84kb
dist/assets/montserrat-latin-100.56b15344.woff2         17.95kb
dist/assets/montserrat-latin-200.dec277a0.woff2         18.52kb
dist/assets/montserrat-latin-400italic.0eeb4ec8.woff2   19.20kb
dist/assets/montserrat-latin-300italic.8a8bc347.woff2   18.93kb
dist/assets/montserrat-latin-300.ab9241a0.woff2         18.54kb
dist/assets/montserrat-latin-400.8767f01c.woff2         18.72kb
dist/assets/montserrat-latin-700.4545eb1d.woff2         19.02kb
dist/assets/montserrat-latin-500italic.11bfeece.woff2   19.16kb
dist/assets/montserrat-latin-600italic.e25106e3.woff2   19.35kb
dist/assets/montserrat-latin-700italic.31d86314.woff2   19.45kb
dist/assets/montserrat-latin-500.965574e9.woff2         18.82kb
dist/assets/montserrat-latin-600.d10e701c.woff2         18.81kb
dist/assets/montserrat-latin-800.5a8c623b.woff2         18.98kb
dist/assets/montserrat-latin-900italic.1cf50fce.woff2   19.21kb
dist/assets/montserrat-latin-800italic.d9a4514f.woff2   19.37kb
dist/assets/montserrat-latin-900.d2fca2ae.woff2         18.79kb
dist/assets/montserrat-latin-100.0b89ea33.woff          21.97kb
dist/assets/montserrat-latin-100italic.8216911f.woff    22.35kb
dist/assets/montserrat-latin-200italic.219d08ee.woff    23.20kb
dist/assets/montserrat-latin-300italic.c65fb5e8.woff    23.19kb
dist/assets/montserrat-latin-200.94221b9a.woff          22.73kb
dist/assets/montserrat-latin-700.2a5afdac.woff          23.28kb
dist/assets/montserrat-latin-400.60cebea4.woff          22.93kb
dist/assets/montserrat-latin-300.25f8f00a.woff          22.71kb
dist/assets/montserrat-latin-500italic.d7b23113.woff    23.49kb
dist/assets/montserrat-latin-400italic.a52bbf7f.woff    23.45kb
dist/assets/montserrat-latin-600italic.681a53b9.woff    23.58kb
dist/assets/montserrat-latin-600.46226abf.woff          23.07kb
dist/assets/montserrat-latin-500.299e5f2b.woff          23.02kb
dist/assets/montserrat-latin-700italic.c900e20b.woff    23.87kb
dist/assets/montserrat-latin-800.2849c719.woff          23.31kb
dist/assets/montserrat-latin-900.f0d96992.woff          23.21kb
dist/assets/montserrat-latin-800italic.a6f84021.woff    23.83kb
dist/assets/montserrat-latin-900italic.18effec3.woff    23.53kb
dist/index.html                                         2.55kb
dist/assets/index.813db5ef.css                          148.35kb / brotli: 23.35kb
dist/assets/index.a5a1e40f.js                           1356.62kb / brotli: skipped (large chunk)
dist/assets/vendor.66caa11e.js                          2959.87kb / brotli: skipped (large chunk)

(!) Some chunks are larger than 500kb after minification. Consider:
- Using dynamic import() to code-split the application
- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/guide/en/#outputmanualchunks
- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
  Done in 212.00s.

vite.config.js

import { defineConfig } from 'vite';
import reactRefresh from '@vitejs/plugin-react-refresh';
import tsconfigPaths from 'vite-tsconfig-paths';
import loadVersion from 'vite-plugin-package-version';
import legacy from '@vitejs/plugin-legacy'

export default defineConfig({
    plugins: [
        reactRefresh(), 
        tsconfigPaths(), 
        loadVersion(),
        legacy({
            targets: ['> 0.5%', 'ie >= 11'],
            polyfills: [
                'es/global-this',
                'es/promise/index',
            ]
        })
    ],
    resolve: {
        alias: {
            'common': 'common'
        }
    },
    css: {
        preprocessorOptions: {
            scss: {
                javascriptEnabled: true,
                additionalData: `@import "./src/styles/variables.scss";`
            }
        }
    },
    publicDir: './public'
});

Before submitting the issue, please make sure you do the following

@andrey-pavlenko
Copy link

I faced this problem too. Configuration in my case

npm i -D regenerator-runtime

vite.config.ts

...
  plugins: [
    vue(),
    legacy({
      targets: ['Chrome >= 49', 'not IE 11'],
      polyfills: ['es/promise'],
      additionalLegacyPolyfills: ['regenerator-runtime/runtime']
    })
  ],
...

Target browsers don't match yours. Maybe my solution will be helpful.

@joshdura
Copy link
Author

I faced this problem too. Configuration in my case

npm i -D regenerator-runtime

vite.config.ts

...
  plugins: [
    vue(),
    legacy({
      targets: ['Chrome >= 49', 'not IE 11'],
      polyfills: ['es/promise'],
      additionalLegacyPolyfills: ['regenerator-runtime/runtime']
    })
  ],
...

Target browsers don't match yours. Maybe my solution will be helpful.

This helped get past that error, thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation plugin: legacy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants