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

TypeError: compilation.getCache is not a function #575

Closed
Iffyyy opened this issue Jan 7, 2021 · 9 comments
Closed

TypeError: compilation.getCache is not a function #575

Iffyyy opened this issue Jan 7, 2021 · 9 comments

Comments

@Iffyyy
Copy link

Iffyyy commented Jan 7, 2021

i install this plugin with npm in my vue project,and configured in vue.config.js.when i start the project,it told me that 'TypeError: compilation.getCache is not a function' at 'copy-webpack-plugin\dist\index.js:459:33'

@killtheliterate
Copy link

@Iffyyy I hit this after a fresh install npm i copy-webpack-plugin — that'll install v7 of the plugin, which requires webpack 5. I'm not using webpack 5, and resolved by npm i copy-webpack-plugin@6.

@sarink
Copy link

sarink commented Jan 8, 2021

Something stating "v6 of this plugin works with webpack v4" really needs to be added to the README.

@alexander-akait
Copy link
Member

Please do not ignore messages from package manager you need webpack@5 for latest version

@AzrizHaziq
Copy link

AzrizHaziq commented Jan 21, 2021

Hi, i'm using copy-webpack-plugin@6.4.1 and webpack@5.16.0 works charmingly node@15.3.0.
For copy-webpack-plugin@7.0.0 and webpack@5.16.0 still got error compilation.getCache.

@alexander-akait
Copy link
Member

@AzrizHaziq it means you still on webpack@4, run npm ls webpack

@AzrizHaziq
Copy link

@alexander-akait

├─┬ copy-webpack-plugin@6.4.1
│ └── webpack@5.16.0 deduped
├─┬ size-plugin@2.0.1
│ └── webpack@5.16.0 deduped
├─┬ terser-webpack-plugin@5.1.1
│ └── webpack@5.16.0 deduped
├─┬ webpack-cli@3.3.12
│ └─┬ webpack@4.46.0
│   └─┬ terser-webpack-plugin@1.4.5
│     └── webpack@4.46.0 deduped
├── webpack@5.16.0
└─┬ xo@0.32.1
  └─┬ eslint-import-resolver-webpack@0.12.2
    └── webpack@5.16.0 deduped
    ```

@alexander-akait
Copy link
Member

update webpack-cli to the 4 version

@AzrizHaziq
Copy link

I think i mess up a little bit. I'm currently using lerna, and strangely it was using webpack@4.*.
Please ignore my previous comment 😄 .

Thanks @alexander-akait.

@omarceloribeiro
Copy link

@Iffyyy I hit this after a fresh install npm i copy-webpack-plugin — that'll install v7 of the plugin, which requires webpack 5. I'm not using webpack 5, and resolved by npm i copy-webpack-plugin@6.

that worked for my issue with spfx projetct! thank so much!!

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

No branches or pull requests

6 participants