Closed ktwbc closed 2 months ago
I am sorry I don't understand the issue here.
Do you mean the assets folder in the public folder? And this folder is breaking your build command?
Thank you for providing more details.
Yes, two folders in assets, bootstrap-icons and boxicons contain package.json files but the other folders under assets do not. Since all of assets would be copied to a production server, it's unusual that they would contain those files.
The reason it breaks the monorepo is when using nx (https://nx.dev), and running the build command, it "build" in nx simply cascades to find all package.json files in all subfolders and run "build" in each of those scripts. This is what you want in a monorepo where one build command builds multiple projects. Because of the package.json files in assets that have a build command under scripts, the monorepo attempts to run it and it fails.
It's easy enough to simply delete the package.json files in those two folders to get around the issue, but I didn't know why they were there in the first place. Assets should be compiled files ready to copy to a server, not full packages that you would find in node_modules.
I think there is no package.json
under this folder?
https://github.com/kitloong/nextjs-dashboard/tree/main/public/assets
This repo has only 1 package.json
, and it is in the root folder.
And I don't have bootstrap-icons
and boxicons
as well.
I'm sorry, I posted this to the wrong repo. I had downloaded two or three different nextjs templates testing things out and the issue I found, I went to the wrong repo to post the issue. This isn't an issue with your repo. Sorry about that.
Why are bootstrap-icons and boxicons under assets full packages with package.json? Dropping this project into a monorepo with nx is beaking on this because the build command is finding the "build" inside those package.jsons. I can delete them but why are they there in the first place?