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

Web worker assets and their respective sourcemaps use different hashes #8089

Closed
7 tasks done
vibaiher-qatium opened this issue May 10, 2022 · 0 comments · Fixed by #7804
Closed
7 tasks done

Web worker assets and their respective sourcemaps use different hashes #8089

vibaiher-qatium opened this issue May 10, 2022 · 0 comments · Fixed by #7804

Comments

@vibaiher-qatium
Copy link

vibaiher-qatium commented May 10, 2022

Describe the bug

When building with vite a web worker with source maps enabled, the generated asset and the generated source map use a different hash code.

When the option is set to true or inline, this is not a problem, but when is set to hidden it causes both files cannot to be linked.

We use an error tracking service to track errors and stack traces, so we use the source maps to improve them, but we do not publish them through the main server since we just upload them to that service, that's why the hidden option fits better.

Reproduction

https://github.com/vibaiher-qatium/test-worker

System Info

System:
  OS: Linux 5.4 Debian GNU/Linux 10 (buster) 10 (buster)
  CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
  Memory: 6.95 GB / 9.73 GB
  Container: Yes
  Shell: 5.0.3 - /bin/bash
Binaries:
Node: 16.5.0 - ~/.nvm/versions/node/v16.5.0/bin/node
Yarn: 1.22.17 - ~/.nvm/versions/node/v16.5.0/bin/yarn
npm: 7.19.1 - ~/.nvm/versions/node/v16.5.0/bin/npm
npmPackages:
vite: ^2.9.7 => 2.9.8

Used Package Manager

npm

Logs

> test-worker@0.0.0 build
> vite build "--debug"

2022-05-10T05:55:11.057Z vite:config bundled config file loaded in 20.24ms
2022-05-10T05:55:11.065Z vite:config using resolved config: {
  build: {
    target: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
    polyfillModulePreload: true,
    outDir: 'dist',
    assetsDir: 'assets',
    assetsInlineLimit: 4096,
    cssCodeSplit: true,
    cssTarget: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
    sourcemap: 'hidden',
    rollupOptions: {},
    minify: 'esbuild',
    terserOptions: {},
    write: true,
    emptyOutDir: null,
    manifest: false,
    lib: false,
    ssr: false,
    ssrManifest: false,
    reportCompressedSize: true,
    chunkSizeWarningLimit: 500,
    watch: null,
    commonjsOptions: { include: [Array], extensions: [Array] },
    dynamicImportVarsOptions: { warnOnError: true, exclude: [Array] }
  },
  configFile: '/home/vicente/sandbox/test-worker/vite.config.js',
  configFileDependencies: [ '/home/vicente/sandbox/test-worker/vite.config.js' ],
  inlineConfig: {
    root: undefined,
    base: undefined,
    mode: undefined,
    configFile: undefined,
    logLevel: undefined,
    clearScreen: undefined,
    build: {}
  },
  root: '/home/vicente/sandbox/test-worker',
  base: '/',
  resolve: { dedupe: undefined, alias: [ [Object], [Object] ] },
  publicDir: '/home/vicente/sandbox/test-worker/public',
  cacheDir: '/home/vicente/sandbox/test-worker/node_modules/.vite',
  command: 'build',
  mode: 'production',
  isWorker: false,
  isProduction: true,
  plugins: [
    'vite:build-metadata',
    'alias',
    'vite:modulepreload-polyfill',
    'vite:resolve',
    'vite:html-inline-proxy',
    'vite:css',
    'vite:esbuild',
    'vite:json',
    'vite:wasm',
    'vite:worker',
    'vite:asset',
    'vite:define',
    'vite:css-post',
    'vite:build-html',
    'vite:worker-import-meta-url',
    'vite:watch-package-data',
    'commonjs',
    'vite:data-uri',
    'rollup-plugin-dynamic-import-variables',
    'vite:asset-import-meta-url',
    'vite:build-import-analysis',
    'vite:esbuild-transpile',
    'vite:terser',
    'vite:reporter',
    'vite:load-fallback'
  ],
  server: {
    preTransformRequests: true,
    fs: { strict: true, allow: [Array], deny: [Array] }
  },
  preview: {
    port: undefined,
    strictPort: undefined,
    host: undefined,
    https: undefined,
    open: undefined,
    proxy: undefined,
    cors: undefined,
    headers: undefined
  },
  env: { BASE_URL: '/', MODE: 'production', DEV: false, PROD: true },
  assetsInclude: [Function: assetsInclude],
  logger: {
    hasWarned: false,
    info: [Function: info],
    warn: [Function: warn],
    warnOnce: [Function: warnOnce],
    error: [Function: error],
    clearScreen: [Function: clearScreen],
    hasErrorLogged: [Function: hasErrorLogged]
  },
  packageCache: Map(0) { set: [Function (anonymous)] },
  createResolver: [Function: createResolver],
  optimizeDeps: {
    esbuildOptions: { keepNames: undefined, preserveSymlinks: undefined }
  },
  worker: {
    format: 'iife',
    plugins: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object]
    ],
    rollupOptions: {}
  }
}
vite v2.9.8 building for production...
transforming...
transforming...
✓ 1 modules transformed.
rendering chunks...
✓ 3 modules transformed.
rendering chunks...
dist/assets/favicon.17e50649.svg     1.49 KiB
dist/assets/worker.aab1c906.js.map   0.15 KiB
dist/assets/worker.76dd98a5.js       0.06 KiB
dist/index.html                      0.39 KiB
dist/assets/index.f3027436.js        0.76 KiB / gzip: 0.44 KiB
dist/assets/index.f3027436.js.map    2.50 KiB

Validations

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