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

Build process hangs at 'modules transformed' with >=2.9.7, works with 2.9.6 #8517

Closed
7 tasks done
johannes-z opened this issue Jun 9, 2022 · 4 comments · Fixed by #8741
Closed
7 tasks done

Build process hangs at 'modules transformed' with >=2.9.7, works with 2.9.6 #8517

johannes-z opened this issue Jun 9, 2022 · 4 comments · Fixed by #8741

Comments

@johannes-z
Copy link

johannes-z commented Jun 9, 2022

Describe the bug

I have a bigger code base that stops working when using the following code while using vite >=2.9.7. I tested older versions and 2.9.6 works.

pageContext?.web?.absoluteUrl ?? window.location.origin

Rolling back to 2.9.6 or changing the code to the following works:

pageContext ? pageContext.web.absoluteUrl : window.location.origin

vite dev works while vite build hangs. The repro only shows the code that causes this issue, but the minimal repro itself works. I'm not sure what exactly causes this issue, but it has to do with the commits in 2.9.7 or upstream.

Reproduction

https://stackblitz.com/edit/vitejs-vite-ksrdie

System Info

System:
    OS: Linux 5.10 Ubuntu 20.04.3 LTS (Focal Fossa)
    CPU: (16) x64 AMD Ryzen 7 PRO 5850U with Radeon Graphics
    Memory: 10.49 GB / 18.62 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 16.13.1 - ~/.nvm/versions/node/v16.13.1/bin/node
    npm: 8.3.0 - ~/.nvm/versions/node/v16.13.1/bin/npm
  npmPackages:
    vite: 2.9.6 => 2.9.6

Used Package Manager

pnpm

Logs

vite:config bundled config file loaded in 148.76ms +0ms
  vite:config using resolved config: {
  vite:config   optimizeDeps: {
  vite:config     entries: 'src/dev.ts',
  vite:config     esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  vite:config   },
  vite:config   css: { modules: { generateScopedName: 'test-[local]' } },
  vite:config   plugins: [
  vite:config     'vite:build-metadata',
  vite:config     'alias',
  vite:config     'vite:modulepreload-polyfill',
  vite:config     'vite:resolve',
  vite:config     'vite:html-inline-proxy',
  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-vue2',
  vite:config     'vite:define',
  vite:config     'vite:css-post',
  vite:config     'vite:build-html',
  vite:config     'vite:worker-import-meta-url',
  vite:config     'vite:watch-package-data',
  vite:config     'commonjs',
  vite:config     'vite:data-uri',
  vite:config     'rollup-plugin-dynamic-import-variables',
  vite:config     'vite:asset-import-meta-url',
  vite:config     'pack-css',
  vite:config     'vite:build-import-analysis',
  vite:config     'vite:esbuild-transpile',
  vite:config     'vite:terser',
  vite:config     'vite:reporter',
  vite:config     'vite:load-fallback'
  vite:config   ],
  vite:config   resolve: {
  vite:config     dedupe: undefined,
  vite:config     alias: [ [Object], [Object], [Object], [Object], [Object] ]
  vite:config   },
  vite:config   define: { _APP_VERSION: '"2.9.0"' },
  vite:config   server: {
  vite:config     preTransformRequests: true,
  vite:config     port: 8080,
  vite:config     host: 'localhost',
  vite:config     hmr: { protocol: 'ws', host: 'localhost', port: '8081' },
  vite:config     fs: { strict: true, allow: [Array], deny: [Array] }
  vite:config   },
  vite:config   build: {
  vite:config     target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     polyfillModulePreload: true,
  vite:config     outDir: 'dist',
  vite:config     assetsDir: 'assets',
  vite:config     assetsInlineLimit: 0,
  vite:config     cssCodeSplit: false,
  vite:config     cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
  vite:config     sourcemap: false,
  vite:config     rollupOptions: {
  vite:config       external: [Function: external],
  vite:config       output: [Object],
  vite:config       plugins: [Array]
  vite:config     },
  vite:config     minify: 'esbuild',
  vite:config     terserOptions: {},
  vite:config     write: true,
  vite:config     emptyOutDir: null,
  vite:config     manifest: false,
  vite:config     lib: {
  vite:config       entry: '/home/<path>/src/main.ts',
  vite:config       name: '<package>',
  vite:config       formats: [Array],
  vite:config       fileName: [Function: fileName]
  vite:config     },
  vite:config     ssr: false,
  vite:config     ssrManifest: false,
  vite:config     reportCompressedSize: true,
  vite:config     chunkSizeWarningLimit: 500,
  vite:config     watch: null,
  vite:config     commonjsOptions: { include: [Array], extensions: [Array] },
  vite:config     dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  vite:config   },
  vite:config   esbuild: { include: /\.ts$/, exclude: /\.(tsx|jsx)$/ },
  vite:config   configFile: '/home/<path>/vite.config.js',
  vite:config   configFileDependencies: [
  vite:config     '/home/<path>/package.json',
  vite:config     '/home/<path>/vite.config.js'
  vite:config   ],
  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: '/home/<path>',
  vite:config   base: '/',
  vite:config   publicDir: '/home/<path>/public',
  vite:config   cacheDir: '/home/<path>/node_modules/.vite',
  vite:config   command: 'build',
  vite:config   mode: 'production',
  vite:config   isWorker: false,
  vite:config   isProduction: true,
  vite:config   preview: {
  vite:config     port: undefined,
  vite:config     strictPort: undefined,
  vite:config     host: 'localhost',
  vite:config     https: undefined,
  vite:config     open: undefined,
  vite:config     proxy: undefined,
  vite:config     cors: undefined,
  vite:config     headers: undefined
  vite:config   },
  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     warnOnce: [Function: warnOnce],
  vite:config     error: [Function: error],
  vite:config     clearScreen: [Function: clearScreen],
  vite:config     hasErrorLogged: [Function: hasErrorLogged]
  vite:config   },
  vite:config   packageCache: Map(0) { set: [Function (anonymous)] },
  vite:config   createResolver: [Function: createResolver],
  vite:config   worker: {
  vite:config     format: 'iife',
  vite:config     plugins: [
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object], [Object],
  vite:config       [Object], [Object]
  vite:config     ],
  vite:config     rollupOptions: {}
  vite:config   }
  vite:config } +17ms
vite v2.9.7 building for production...
✓ 644 modules transformed.

Validations

@johannes-z johannes-z changed the title Build process hangs at 644 modules transformed with >=2.9.7, works with 2.9.6 Build process hangs at 'modules transformed' with >=2.9.7, works with 2.9.6 Jun 9, 2022
@sapphi-red
Copy link
Member

@johannes-z This might be a duplicate of #8099. #8110 fixed that. It may fix this too. Have you tried 2.9.9?

@johannes-z
Copy link
Author

@sapphi-red Yes, I was on v2.9.10 when I noticed the issue, and then tried every single version until I got to one, where the issue was gone.

@sapphi-red
Copy link
Member

@johannes-z Would you provide a full project if possible? If not possible, would you try to create a minimal reproduction of it? There's nothing I could do here without it.

One thing worth trying is to set build.lib.format = ['es']. If this works, #7948 is affecting this.

@github-actions
Copy link

Hello @johannes-z. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants