webdeveric / next-assets-manifest Goto Github PK
View Code? Open in Web Editor NEWAdd webpack-assets-manifest to your Next.js project.
Add webpack-assets-manifest to your Next.js project.
After adding simple assetsMenifest in next.config.js and trying to run npm run build. However, the build fails and does not generate assets-manifest.js.
The build is failing with following output in the console.
> Build error occurred
ValidationError: Invalid schema object. WebpackAssetsManifest has been initialized using a schema object that does not match the API schema.
- schema has an unknown property 'nextOptions'. These properties are valid:
object { enabled?, assets?, output?, replacer?, space?, writeToDisk?, fileExtRegex?, sortManifest?, merge?, publicPath?, contextRelativeKeys?, apply?, customize?, transform?, done?, entrypoints?, entrypointsKey?, entrypointsUseAssets?, integrity?, integrityHashes?, integrityPropertyName? }
-> Webpack Assets Manifest options
at validate (E:\AEM\nextjs-sample-app\node_modules\schema-utils\dist\validate.js:105:11)
at E:\AEM\nextjs-sample-app\node_modules\next-assets-manifest\node_modules\webpack-assets-manifest\src\WebpackAssetsManifest.js:73:7
at SyncHook.eval [as call] (eval at create (E:\AEM\nextjs-sample-app\node_modules\next-assets-manifest\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:7:1)
at SyncHook.lazyCompileHook (E:\AEM\nextjs-sample-app\node_modules\next-assets-manifest\node_modules\tapable\lib\Hook.js:154:20)
at WebpackAssetsManifest.apply (E:\AEM\nextjs-sample-app\node_modules\next-assets-manifest\node_modules\webpack-assets-manifest\src\WebpackAssetsManifest.js:119:29)
at createCompiler (E:\AEM\nextjs-sample-app\node_modules\next\dist\compiled\webpack\bundle5.js:134206:12)
at create (E:\AEM\nextjs-sample-app\node_modules\next\dist\compiled\webpack\bundle5.js:134267:16)
at webpack (E:\AEM\nextjs-sample-app\node_modules\next\dist\compiled\webpack\bundle5.js:134291:32)
at Object.f [as webpack] (E:\AEM\nextjs-sample-app\node_modules\next\dist\compiled\webpack\bundle5.js:89548:16)
at E:\AEM\nextjs-sample-app\node_modules\next\dist\build\compiler.js:31:40 {
errors: [
{
keyword: 'additionalProperties',
dataPath: '',
schemaPath: '#/additionalProperties',
params: [Object],
message: 'should NOT have additional properties',
schema: false,
parentSchema: [Object],
data: [Object]
}
],
schema: {
title: 'Webpack Assets Manifest options schema',
description: 'Webpack Assets Manifest options',
type: 'object',
additionalProperties: false,
properties: {
enabled: [Object],
assets: [Object],
output: [Object],
replacer: [Object],
space: [Object],
writeToDisk: [Object],
fileExtRegex: [Object],
sortManifest: [Object],
merge: [Object],
publicPath: [Object],
contextRelativeKeys: [Object],
apply: [Object],
customize: [Object],
transform: [Object],
done: [Object],
entrypoints: [Object],
entrypointsKey: [Object],
entrypointsUseAssets: [Object],
integrity: [Object],
integrityHashes: [Object],
integrityPropertyName: [Object]
},
definitions: { functionOrNull: [Object] }
},
headerName: 'WebpackAssetsManifest',
baseDataPath: 'schema',
postFormatter: null
}
info - Creating an optimized production build .npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nextjs-sample-app@ build: `next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nextjs-sample-app@ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\<my_user>\AppData\Roaming\npm-cache\_logs\2021-12-16T21_04_34_217Z-debug.log
The next.js app is pretty basic. Trying to rum build just after creating new next.js app using npx create-next-app command.
package.json file dependencies reference
{
"name": "nextjs-sample-app",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"next": "12.0.7",
"next-assets-manifest": "^0.2.0",
"react": "17.0.2",
"react-dom": "17.0.2",
"webpack-assets-manifest": "^5.0.6",
"xmldom": "^0.6.0"
},
"devDependencies": {
"eslint": "8.4.1",
"eslint-config-next": "12.0.7"
}
}
v12.0.7
next.config.js file
const withAssetsManifest = require("next-assets-manifest");
module.exports = withAssetsManifest({
assetsManifest: {
// https://github.com/webdeveric/webpack-assets-manifest#options-read-the-schema
output: "assets-manifest.json",
},
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.