Polyfill Chunk Error in Next.js 12
Unanswered
kylemh posted this in #help-forum
kylemhOP
Hello! We use LogRocket to record our users' sessions, and we're noticing a GET request that has a failure response in almost every session. The request is to mycompany.com/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js and is initiated via a script tag.
How can I prevent these failures? Why is this happening?
How can I prevent these failures? Why is this happening?
1 Reply
kylemhOP
I checked out the Next.js repo at v12.3.4 and see the following code:
Somehow this ends up as a <script> tag with a src value that has no available target.
isClient &&
new CopyFilePlugin({
filePath: require.resolve('./polyfills/polyfill-nomodule'),
cacheKey: process.env.__NEXT_VERSION as string,
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
minimize: false,
info: {
[CLIENT_STATIC_FILES_RUNTIME_POLYFILLS_SYMBOL]: 1,
// This file is already minified
minimized: true,
},
}),Somehow this ends up as a <script> tag with a src value that has no available target.
<script defer="" nomodule="" src="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script>