-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 use [chunkhash] when I run: webpack-dev-server --hot #377
Comments
Just came across this myself - curious to know if it's expected behaviour or not... |
Got this weird issue too. BTW, @andreisoare 'babel-polyfill' and NamedModulesPlugin significantly increase the bundle size. And I think you can remove 'babel-polyfill' since you use 'transform-runtime'. |
Appears to be expected behavior: webpack/webpack#2393 (comment) |
Closing this, because you should not use I am working on documenting this, because this has caused many issues. |
Shouldn't this decision be left to the developer to decide? It's possible that webpack will create new files, but plugin's exist to clean up those old files. https://github.com/gpbl/webpack-cleanup-plugin for example. I'm fairly new to web development and webpack, but wouldn't cache-busting still be useful for development? |
No, you should have every caching feature off in dev. There's no real benefit; you're working on localhost anyway, so downloading is only limited by your |
The issue is closed, but no any solution has been provided. How do you solve the problem? filename: `[name]${isDev ? '' : '[chunkhash:8]'}.js`, Does any of you know better solution? |
@just-boris, jup, that's the solution I use in all my projects too. It's not very clean but works perfectly. |
@SpaceK33z looking at adopting this pattern for our own project but I have a question: if the bundle no longer has a hash in the name, how do we prevent the browser from caching a stale version of the bundle from a previous run? |
@SpaceK33z Hi, have you landed the mentioned documentation for this issue somewhere? |
👍 Make sense :) |
Folks, I'm interested about memory leak when hash is used. Memory leak in what? Is there any bug ticket related to the memory leak when hash is used? I'd like to read more about it. Thank you. |
This is a zombie issue (lol), it just won't die! I thought this issue was solved when @just-boris posted the following, which certainly voiced my frustration that no one was posting a solution to the issue:
I am migrating websites to Webpack 4 this weekend, and my issue is that the concept of "environment" in Webpack has changed in v4. There is no longer a value for For those in the same boat I offer my current solution, albeit hacky. After dumping
|
Development builts with HMR enabled have a bunch of problems with hashes in filenames (e.g., webpack/webpack-dev-server#377 (comment)). But to mitigate the Safari caching issue, hashes cannot be omitted. So move them to query parameters to see if this works.
closes #2492 The change was intended to mitigate the problem that Safari keeps caching dev bundles. But it caused several unintended bugs: 1. [Hashes in file names with HMR enabled might cause memory leaks](webpack/webpack-dev-server#377 (comment)) 2. Moving the hash to file query also breaks many webpack loaders: 1. [mocha-webpack](f683583) 2. [django-webpack-loader](#2492)) So till we find a better way to solve this issue, hashes in dev bundles should be removed.
closes #2492 The change was intended to mitigate the problem that Safari keeps caching dev bundles. But it caused several unintended bugs: 1. [Hashes in file names with HMR enabled might cause memory leaks](webpack/webpack-dev-server#377 (comment)) 2. Moving the hash to file query also breaks many webpack loaders: 1. [mocha-webpack](f683583) 2. [django-webpack-loader](#2492)) So till we find a better way to solve this issue, hashes in dev bundles should be removed.
Bumps [@vue/cli-plugin-babel](https://github.com/vuejs/vue-cli) from 3.0.1 to 3.0.3. <details> <summary>Changelog</summary> *Sourced from [@vue/cli-plugin-babel's changelog](https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md).* > # [3.0.3](vuejs/vue-cli@v3.0.2...v3.0.3) (2018-09-12) > > ## cli-plugin-unit-mocha > > #### Bug Fixes > > * revert file name hashing in dev mode ([0909bc8](vuejs/vue-cli@0909bc8)), closes [#2492](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2492) [/github-redirect.dependabot.com/webpack/webpack-dev-server/issues/377#issuecomment-241258405](https://github.com//github-redirect.dependabot.com/webpack/webpack-dev-server/issues/377/issues/issuecomment-241258405) > > ## cli-service > > #### Bug Fixes > > * fix ESDIR errors when outputDir contains dots ([1682ff7](vuejs/vue-cli@1682ff7)), closes [#2414](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2414) > * hash module ids in anonymous chunks, avoid ENAMETOOLONG error ([69cec80](vuejs/vue-cli@69cec80)), closes [#2490](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2490) > > > > # [3.0.2](vuejs/vue-cli@v3.0.1...v3.0.2) (2018-09-11) > > ## cli > > #### Bug Fixes > > * names of Sass and Less ([#2384](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2384)) ([ff57b8f](vuejs/vue-cli@ff57b8f)) > * support generator/index.js in local presets ([#2263](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2263)) ([ecb8c18](vuejs/vue-cli@ecb8c18)), closes [#2172](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2172) > * use sync fs methods in writeFileTree ([#2341](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2341)) ([ba15fa2](vuejs/vue-cli@ba15fa2)), closes [#2275](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2275) > * **plugin api:** fix generator dotfile rename for Windows. ([#2427](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2427)) ([3f434f6](vuejs/vue-cli@3f434f6)), closes [#2424](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2424) > > ## cli-plugin-babel > > #### Bug Fixes > > * fix require('[[**vue**](https://github.com/vue)](https://github.com/vue)/babel-preset-app').version return undefined bug ([#2393](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2393)) ([f0bddd8](vuejs/vue-cli@f0bddd8)) > * fix scoped modules exclusion on windows ([#2379](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2379)) ([3247719](vuejs/vue-cli@3247719)), closes [#2251](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2251) > > ## cli-plugin-eslint > > #### Bug Fixes > > * also lint nested js files starting with dot ([b81d11e](vuejs/vue-cli@b81d11e)) > > ## cli-plugin-unit-jest > > #### Bug Fixes > > * **cli-plugin-unit-jest:** also process SVG files with jest-transform-stub ([#2368](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2368)) ([3def765](vuejs/vue-cli@3def765)) > * ensure unit test examples work in projects created with --bare ([b62c6ba](vuejs/vue-cli@b62c6ba)), closes [#2262](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2262) > > ## cli-plugin-unit-mocha > ></table> ... (truncated) </details> <details> <summary>Commits</summary> - [`3015bc2`](vuejs/vue-cli@3015bc2) v3.0.3 - [`0580415`](vuejs/vue-cli@0580415) chore: pre release sync - [`1682ff7`](vuejs/vue-cli@1682ff7) fix: fix ESDIR errors when outputDir contains dots - [`0909bc8`](vuejs/vue-cli@0909bc8) fix: revert file name hashing in dev mode - [`69cec80`](vuejs/vue-cli@69cec80) fix: hash module ids in anonymous chunks, avoid ENAMETOOLONG error - [`f720ff8`](vuejs/vue-cli@f720ff8) chore: fix changelog links [ci skip] - [`cfc0808`](vuejs/vue-cli@cfc0808) docs: merge branch 'docs' into dev [ci skip] - [`0a49378`](vuejs/vue-cli@0a49378) chore: 3.0.2 changelog [ci skip] - [`3372698`](vuejs/vue-cli@3372698) v3.0.2 - [`efde561`](vuejs/vue-cli@efde561) chore: pre release sync - Additional commits viewable in [compare view](vuejs/vue-cli@v3.0.1...v3.0.3) </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=@vue/cli-plugin-babel&package-manager=npm_and_yarn&previous-version=3.0.1&new-version=3.0.3)](https://dependabot.com/compatibility-score.html?dependency-name=@vue/cli-plugin-babel&package-manager=npm_and_yarn&previous-version=3.0.1&new-version=3.0.3) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot. </details>
Bumps [@vue/cli-plugin-eslint](https://github.com/vuejs/vue-cli) from 3.0.1 to 3.0.3. <details> <summary>Changelog</summary> *Sourced from [@vue/cli-plugin-eslint's changelog](https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md).* > # [3.0.3](vuejs/vue-cli@v3.0.2...v3.0.3) (2018-09-12) > > ## cli-plugin-unit-mocha > > #### Bug Fixes > > * revert file name hashing in dev mode ([0909bc8](vuejs/vue-cli@0909bc8)), closes [#2492](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2492) [/github-redirect.dependabot.com/webpack/webpack-dev-server/issues/377#issuecomment-241258405](https://github.com//github-redirect.dependabot.com/webpack/webpack-dev-server/issues/377/issues/issuecomment-241258405) > > ## cli-service > > #### Bug Fixes > > * fix ESDIR errors when outputDir contains dots ([1682ff7](vuejs/vue-cli@1682ff7)), closes [#2414](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2414) > * hash module ids in anonymous chunks, avoid ENAMETOOLONG error ([69cec80](vuejs/vue-cli@69cec80)), closes [#2490](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2490) > > > > # [3.0.2](vuejs/vue-cli@v3.0.1...v3.0.2) (2018-09-11) > > ## cli > > #### Bug Fixes > > * names of Sass and Less ([#2384](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2384)) ([ff57b8f](vuejs/vue-cli@ff57b8f)) > * support generator/index.js in local presets ([#2263](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2263)) ([ecb8c18](vuejs/vue-cli@ecb8c18)), closes [#2172](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2172) > * use sync fs methods in writeFileTree ([#2341](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2341)) ([ba15fa2](vuejs/vue-cli@ba15fa2)), closes [#2275](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2275) > * **plugin api:** fix generator dotfile rename for Windows. ([#2427](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2427)) ([3f434f6](vuejs/vue-cli@3f434f6)), closes [#2424](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2424) > > ## cli-plugin-babel > > #### Bug Fixes > > * fix require('[[**vue**](https://github.com/vue)](https://github.com/vue)/babel-preset-app').version return undefined bug ([#2393](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2393)) ([f0bddd8](vuejs/vue-cli@f0bddd8)) > * fix scoped modules exclusion on windows ([#2379](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2379)) ([3247719](vuejs/vue-cli@3247719)), closes [#2251](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2251) > > ## cli-plugin-eslint > > #### Bug Fixes > > * also lint nested js files starting with dot ([b81d11e](vuejs/vue-cli@b81d11e)) > > ## cli-plugin-unit-jest > > #### Bug Fixes > > * **cli-plugin-unit-jest:** also process SVG files with jest-transform-stub ([#2368](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2368)) ([3def765](vuejs/vue-cli@3def765)) > * ensure unit test examples work in projects created with --bare ([b62c6ba](vuejs/vue-cli@b62c6ba)), closes [#2262](https://github-redirect.dependabot.com/vuejs/vue-cli/issues/2262) > > ## cli-plugin-unit-mocha > ></table> ... (truncated) </details> <details> <summary>Commits</summary> - [`3015bc2`](vuejs/vue-cli@3015bc2) v3.0.3 - [`0580415`](vuejs/vue-cli@0580415) chore: pre release sync - [`1682ff7`](vuejs/vue-cli@1682ff7) fix: fix ESDIR errors when outputDir contains dots - [`0909bc8`](vuejs/vue-cli@0909bc8) fix: revert file name hashing in dev mode - [`69cec80`](vuejs/vue-cli@69cec80) fix: hash module ids in anonymous chunks, avoid ENAMETOOLONG error - [`f720ff8`](vuejs/vue-cli@f720ff8) chore: fix changelog links [ci skip] - [`cfc0808`](vuejs/vue-cli@cfc0808) docs: merge branch 'docs' into dev [ci skip] - [`0a49378`](vuejs/vue-cli@0a49378) chore: 3.0.2 changelog [ci skip] - [`3372698`](vuejs/vue-cli@3372698) v3.0.2 - [`efde561`](vuejs/vue-cli@efde561) chore: pre release sync - Additional commits viewable in [compare view](vuejs/vue-cli@v3.0.1...v3.0.3) </details> <br /> [![Dependabot compatibility score](https://api.dependabot.com/badges/compatibility_score?dependency-name=@vue/cli-plugin-eslint&package-manager=npm_and_yarn&previous-version=3.0.1&new-version=3.0.3)](https://dependabot.com/compatibility-score.html?dependency-name=@vue/cli-plugin-eslint&package-manager=npm_and_yarn&previous-version=3.0.1&new-version=3.0.3) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Automerge options (never/patch/minor, and dev/runtime dependencies) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired) Finally, you can contact us by mentioning @dependabot. </details>
I understand this is closed. But I would like to add a scenario that it would have been helpful if we could disable cache for dev server. |
…ng dev-server Using output hashing with the dev-server can cause memory leaks because the dev server does not know when to clean up the old files. See: webpack/webpack-dev-server#377 (comment) Closes #10411
…ng dev-server Using output hashing with the dev-server can cause memory leaks because the dev server does not know when to clean up the old files. See: webpack/webpack-dev-server#377 (comment) Closes #10411
Development builts with HMR enabled have a bunch of problems with hashes in filenames (e.g., webpack/webpack-dev-server#377 (comment)). But to mitigate the Safari caching issue, hashes cannot be omitted. So move them to query parameters to see if this works.
closes #2492 The change was intended to mitigate the problem that Safari keeps caching dev bundles. But it caused several unintended bugs: 1. [Hashes in file names with HMR enabled might cause memory leaks](webpack/webpack-dev-server#377 (comment)) 2. Moving the hash to file query also breaks many webpack loaders: 1. [mocha-webpack](vuejs/vue-cli@f683583) 2. [django-webpack-loader](vuejs/vue-cli#2492)) So till we find a better way to solve this issue, hashes in dev bundles should be removed.
Development builts with HMR enabled have a bunch of problems with hashes in filenames (e.g., webpack/webpack-dev-server#377 (comment)). But to mitigate the Safari caching issue, hashes cannot be omitted. So move them to query parameters to see if this works.
closes #2492 The change was intended to mitigate the problem that Safari keeps caching dev bundles. But it caused several unintended bugs: 1. [Hashes in file names with HMR enabled might cause memory leaks](webpack/webpack-dev-server#377 (comment)) 2. Moving the hash to file query also breaks many webpack loaders: 1. [mocha-webpack](vuejs/vue-cli@f683583) 2. [django-webpack-loader](vuejs/vue-cli#2492)) So till we find a better way to solve this issue, hashes in dev bundles should be removed.
I'm getting the following error when I run
webpack-dev-server --hot
.I do not get this error if I run
webpack-dev-server
without the--hot
flag, or if I just runwebpack
to build the files.This is my config file:
Is this expected behaviour, or a bug?
If it's not expected behaviour, I'd be happy to strip down this config file and create a minimal github repo that reproduces this bug.
Also - I wasn't sure whether to report this in webpack-dev-server or in webpack.
Thanks!
The text was updated successfully, but these errors were encountered: