aws / aws/jsii

jsii-config produces non working configuration

Open
#4,705 10 comments 0 reactions 0 assignees View on GitHub
bug p1
Dominant language
TypeScript
Stars
2.9k
Forks
267
Avg merge
1d 25m
Merged PRs (30d)
14

Description

### Describe the bug

I am getting started with jsii. I facing an issue when running `npm run build`. Below is my jsii configuration as created by `jsii-config`

```{
"...",
"keywords": [],
"author": {
"name": "Ganesh Kumar",
"email": "ganesh.kumar@acme.com"
},
"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

Contributor guide

Open the contributing guide

Research direction

Start by examining the configuration generated by jsii-config and the npm run build entry point, using the reported Windows path mismatch as the reproduction. Compare how the project directory and main file are resolved; done means the sample configuration resolves the project’s index.ts and npm run build generates the Java files.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.