I was trying to make my first forge app, I followed all the instructions, I created the app, but when I used forge deploy I got this error:
Error: Bundling failed: Module not found: Error: Can't resolve '@forge/ui' in 'C:\Users\Ezequiel\IdeaProjects\lesson1_forge\src'
Error: Bundling failed: Module not found: Error: Can't resolve '@forge/ui' in 'C:\Users\Ezequiel\IdeaProjects\lesson1_forge\src'
at AppPackager.package (C:\Users\Ezequiel\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\packager\packager.js:39:23)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async PackageUploadDeployCommand.execute (C:\Users\Ezequiel\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\package-upload-deploy.js:11:45)
at async CommandLineUI.displayProgress (C:\Users\Ezequiel\AppData\Roaming\npm\node_modules\@forge\cli\node_modules\@forge\cli-shared\out\ui\command-line-ui.js:44:28)
at async DeployView.reportDeploymentProgress (C:\Users\Ezequiel\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\view\deploy-view.js:50:24)
at async DeployController.run (C:\Users\Ezequiel\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\deploy-controller.js:122:27)
at async Command.actionProcessor (C:\Users\Ezequiel\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\command.js:76:32)
What can I do? I tried all things that could be on my mind and I canāt get past this part.
This normally happens if node_modules directory is not present in your project directory. If this is indeed the case, do an npm install first then call forge deploy again.
Thanks for the solution,
Unfortunately it didnāt work, I already have node_modules, I already did npm install, and the error is still there. I even changed from windows to linux, and in linux I get a similar error, I got this one:
error manifest.yml failed to parse content - end of the stream or a document separator is expected valid-yaml-required
Error: Command failed due to validation error.
Error: Command failed due to validation error.
at PreCommandController.runChecks (/home/ezequiel/.nvm/versions/node/v16.14.2/lib/node_modules/@forge/cli/out/command-line/controller/pre-command-controller.js:24:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /home/ezequiel/.nvm/versions/node/v16.14.2/lib/node_modules/@forge/cli/out/command-line/controller/pre-command-controller.js:32:13
at async Command.checkPreconditions (/home/ezequiel/.nvm/versions/node/v16.14.2/lib/node_modules/@forge/cli/out/command-line/command.js:249:27)
at async Command.actionProcessor (/home/ezequiel/.nvm/versions/node/v16.14.2/lib/node_modules/@forge/cli/out/command-line/command.js:70:53)
So right now I am with an error on both operating systems and donāt know how to fix it.
Thatās interesting. Have you tried installing @forge/ui by doing npm i @forge/ui if that fixes the module not found error?
The error you get on linux looks different from the one you got on Windows - the linux error smells like your manifest is malformed somehow while the Windows error is pointing to a missing module that you need to install.
Can you share the link to the instructions you followed so that we can verify if there are missing steps? I followed this tutorial just now and I was able to do a forge deploy successfully. For reference, I am using Forge CLI version 4.1.0.
Iām facing the same problem while deploying UI Kit app.
Iāve provided the required permissions, @forge/api is also present in my package.json file, forge/api file is also present in my node_modules. Iāve already run the ānpm install @forge/apiā, ānmp install -e developmentā and "npm install"all these commands but still Iām getting the following error.
Please help with this.
Error: Bundling failed: Module not found: Error: Canāt resolve āforge/apiā in āC:\ASPL\Forge Development\First-App\srcā
Error: Bundling failed: Module not found: Error: Canāt resolve āforge/apiā in āC:\ASPL\Forge Development\First-App\srcā
at RuntimeBundler.bundle (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\deploy\packager\runtime-bundler.js:27:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AppPackager.package (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\deploy\packager\packager.js:16:31)
at async PackageUploadDeployCommand.execute (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\deploy\package-upload-deploy.js:14:76)
at async CommandLineUI.displayProgress (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\node_modules@forge\cli-shared\out\ui\command-line-ui.js:46:28)
at async DeployView.reportDeploymentProgress (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\command-line\view\deploy-view.js:79:24) at async DeployController.run (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\command-line\controller\deploy-controller.js:172:27)
at async Command.actionProcessor (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\command-line\command.js:91:32)
at async Promise.all (index 0)
at async Command.parse (C:\Users\chaud\AppData\Roaming\npm\node_modules@forge\cli\out\command-line\command.js:194:13)
It looks like youāve copied project code file from another project folder and module is yet to be installed on a new folder. Following command should work in either case,