Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error JSII4: Could not find "main" file: #4691

Open
1 task
ganeshltimindtree opened this issue Nov 10, 2024 · 0 comments
Open
1 task

error JSII4: Could not find "main" file: #4691

ganeshltimindtree opened this issue Nov 10, 2024 · 0 comments
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.

Comments

@ganeshltimindtree
Copy link

ganeshltimindtree commented Nov 10, 2024

Describe the bug

I am getting started with jsii. I facing an issue when running npm run build. Below is my jsii configuration

  "...",
  "keywords": [],
  "author": {
    "name": "Ganesh Kumar",
    "email": "[email protected]"
  },
  "repository": {
    "url": "https://github.com/ganesh/jsii-getting-started.git"
  },
  "license": "ISC",
  "stability": "stable",
  "types": "index.d.ts",
  "jsii": {
    "versionFormat": "full",
    "targets": {
      "java": {
        "package": "com.ganesh.learn.jsii",
        "maven": {
          "groupId": "com.ganesh.learn",
          "artifactId": "jsii"
        }
      }
    },
    "tsc": {
      "outDir": "dist"
    }
  },
  "devDependencies": {
    "jsii": "^5.5.9",
    "jsii-pacmak": "^1.104.0"
  }
}

The error I am getting is

[2024-11-10T12:04:33.432] [ERROR] jsii/compiler - Type model errors prevented the JSII assembly from being created
error JSII4: Could not find "main" file: C:\Workspace\internal\index.ts

The project is in C:\Workspace\internal\jsii-getting-started. It seems jsii is looking at the parent directory rather than the project directory.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

jsii should generate Java files

Current Behavior

I am getting this error

[2024-11-10T12:04:33.432] [ERROR] jsii/compiler - Type model errors prevented the JSII assembly from being created
error JSII4: Could not find "main" file: C:\Workspace\internal\index.ts

Reproduction Steps

Follow the steps listed in the documentation to create a sample project. Run the command npm run build. You will get the error in Windows 11 enterprise

Possible Solution

None

Additional Information/Context

No response

SDK version used

jsii: 5.5.9 & jsii-pacmak: 1.104.0

Environment details (OS name and version, etc.)

Windows 11 Enterprise

@ganeshltimindtree ganeshltimindtree added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant