Noob - Trying to deploy Hello world! example

Someone can help me, i’m trying to deploy and got this error. Regards

PS C:\Program Files\nodejs\node_modules\npm\hello-word-app> forge deploy --verbose
Deploying your app to the development environment.
Press Ctrl+C to cancel.

Running forge lint...
No issues found.

▶️  GraphQL https://api.atlassian.com/graphql
Query:
          query forge_cli_getMigrationKeys($id: ID!, $key: String!) {
            app(id: $id) {
              environmentByKey(key: $key) {
                id
                versions(first: 1) {
                  edges {
                    node {
                      isLatest
                      migrationKeys {
                        jira
                        confluence
                      }
                    }
                  }
                }
              }
              marketplaceApp {
                appKey
              }
            }
          }

Variables: {
  "id": "ari:cloud:ecosystem::app/f294d0b6-5f4f-49de-af6b-f57c22476eb2",
  "key": "default"
}
◀️  GraphQL
Request ID: b2649dc44f0097d7
Result: {
  "app": {
    "environmentByKey": {
      "id": "ce6281b4-43f4-4cae-898e-e82485f603e9",
      "versions": {
        "edges": [
          {
            "node": {
              "isLatest": true,
              "migrationKeys": null
            }
          }
        ]
      }
    },
    "marketplaceApp": null
  }
}
▶️  GraphQL https://api.atlassian.com/graphql
Query:
      query forge_cli_getApplicationInstallations($id: ID!) {
        app(id: $id) {
          environments {
            key
            installations {
              id
              installationContext,
              version {
                isLatest
              }
            }
          }
        }
      }

Variables: {
  "id": "ari:cloud:ecosystem::app/f294d0b6-5f4f-49de-af6b-f57c22476eb2"
}
◀️  GraphQL
Request ID: 58342ef4bb77633b
Result: {
  "app": {
    "environments": [
      {
        "key": "production",
        "installations": []
      },
      {
        "key": "staging",
        "installations": []
      },
      {
        "key": "default",
        "installations": []
      }
    ]
  }
}
Deploying your app to development...

i Packaging app files

Error: Bundling failed: ./src/index.jsx 5:1
Module parse failed: Unexpected token (5:1)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const App = () => {
|   return (
>       <Fragment>
|       <Text>Hello world!</Text>
|     </Fragment>

Error: Bundling failed: ./src/index.jsx 5:1
Module parse failed: Unexpected token (5:1)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| const App = () => {
|   return (
>       <Fragment>
|       <Text>Hello world!</Text>
|     </Fragment>
    at AppPackager.package (C:\Users\denis\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\packager\packager.js:39:23)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async PackageUploadDeployCommand.execute (C:\Users\denis\AppData\Roaming\npm\node_modules\@forge\cli\out\deploy\package-upload-deploy.js:11:45)
    at async CommandLineUI.displayProgress (C:\Users\denis\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\denis\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\view\deploy-view.js:50:24)
    at async DeployController.run (C:\Users\denis\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\controller\deploy-controller.js:122:27)
    at async Command.actionProcessor (C:\Users\denis\AppData\Roaming\npm\node_modules\@forge\cli\out\command-line\command.js:74:32)

Hi @SpidMan

Module parse failed: Unexpected token (5:1)

This part assumes you have a syntax error in your JSX file. Could you please share file contents here?

Well it is the file created by the command forge create with UI kit category and jira-issue-panel template

With the original file the error was in (5:4) i have replaced spaces with one tabs and it was now at (5:1)

import ForgeUI, { render, Fragment, Text, IssuePanel } from '@forge/ui';

const App = () => {
	return (
		<Fragment>
			<Text>Hello world!</Text>
		</Fragment>
	);
};

export const run = render(
	<IssuePanel>
		<App />
	</IssuePanel>
);

Finally found my problem

Removed forge package
Reinstall forge package

PS C:\Program Files\nodejs> npm install -g @forge/cli

added 768 packages, and audited 769 packages in 29s

37 vulnerabilities (18 moderate, 19 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

and this time i didn’t run

npm audit fix --force

even if i have 19 high vulnerabilities and it work like a charm, don’t like it but if it works don’t … :slight_smile:

Special thanks to Peter for this lead

1 Like

Glad you were able to solve the problem @SpidMan!

One thing to keep in mind is that --force allows npm audit fix to update dependencies outside of their declared supported version range, so it can introduce issues like you were seeing.

1 Like