You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /node_modules/@contentlayer/core/dist/generation/generate-dotpkg.js for build dependencies failed at 'import(filePathJoin(generatedPkgPath, 'generated', 'index.mjs'))'.
#667
Open
JamesIves opened this issue
Jul 4, 2024
· 6 comments
Been seeing this warning as of late, and I'm unsure what the actual cause is here. Seems to stem from generate-dotpkg.js.
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of node_modules/@contentlayer/core/dist/generation/generate-dotpkg.js for build dependencies failed at 'import(filePathJoin(generatedPkgPath, 'generated', 'index.mjs'))'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] at file dependencies node_modules/@contentlayer/core/dist/generation/generate-dotpkg.js
at file node_modules/@contentlayer/core/dist/generation/generate-dotpkg.js
at resolve esm file ./generation/generate-dotpkg.js
at file dependencies node_modules/@contentlayer/core/dist/index.js
at file node_modules/@contentlayer/core/dist/index.js
at resolve esm file @contentlayer/core
at file dependencies node_modules/next-contentlayer/dist/plugin.js
at file node_modules/next-contentlayer/dist/plugin.js
at resolve esm file ./plugin.js
at file dependencies node_modules/next-contentlayer/dist/index.js
at file node_modules/next-contentlayer/dist/index.js
at resolve esm file next-contentlayer
at file dependencies next.config.mjs
at file next.config.mjs
at resolve commonjs next.config.mjs
[webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] SyntaxError: Unexpected token 'i', "filePathJoi"... is not valid JSON
at JSON.parse (<anonymous>)
at parseString (node_modules/next/dist/compiled/webpack/bundle5.js:28:260457)
at node_modules/next/dist/compiled/webpack/bundle5.js:28:276877
at node_modules/next/dist/compiled/webpack/bundle5.js:1:268942
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)
at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)
This warning occurs because Webpack is unable to statically analyze a dynamic import() statement with a variable path in the Contentlayer package's generate-dotpkg.js file:
Webpack relies on static analysis to determine module dependencies during the build process. When it encounters a dynamic import where the module path isn't a static string, it can't resolve the dependencies at build time. This leads to the warning:
Parsing of ... generate-dotpkg.js for build dependencies failed at 'import(filePathJoin(...))'.
Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
As a result, Webpack warns that it cannot track the dependencies behind this dynamic import, which might lead to incorrect cache invalidation because it doesn't know when to rebuild these dependencies if they change.
Been seeing this warning as of late, and I'm unsure what the actual cause is here. Seems to stem from
generate-dotpkg.js
.Versions:
The text was updated successfully, but these errors were encountered: