-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Generated Types are Broken #7488
Comments
This was already fixed by #7426 But I think you didn't install that change. |
What versions of nightly need to be installed? |
I cloned your repo at jvanderen1/unstated-next@c934929 and used Yarn instead of npm to workaround #7489. |
Thank you very much! I love how awesome the dev's have been 💯 |
@mischnic I just tried installing the nightlies and I'm still running into the bad type compilation issue. "devDependencies": {
"@babel/core": "^7.16.7",
"@babel/preset-env": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@parcel/babel-preset-env": "^2.0.0-nightly.961",
"@parcel/config-default": "^2.0.0-nightly.961",
"@parcel/core": "^2.0.0-nightly.961",
"@parcel/packager-ts": "^2.0.0-nightly.961",
"@parcel/transformer-typescript-types": "^2.0.0-nightly.961",
"@parcel/validator-typescript": "^2.0.0-nightly.961",
"@types/jest": "^27.4.0",
"@types/node": "^17.0.5",
"@typescript-eslint/eslint-plugin": "^5.8.1",
"@typescript-eslint/parser": "^5.8.1",
"eslint": "^8.5.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-jest": "^25.3.3",
"jest": "^27.4.5",
"parcel": "^2.0.0-nightly.961",
"prettier": "^2.5.1",
"typescript": "^4.5.4"
} Result: import { EventEmitter as } from "events";
import { Getter as , Options as , Schema as } from "./main.d"; |
@selfagency Are you using yarn? When I retried using yarn, the versions I got in my package.json were "nightly" and it worked. I believe there's apparent versioning incompatibilities between some parcel packages. |
For example these packages were all published at the same time:
|
@jvanderen1 @mischnic I am using Also, how do I get the generated types file to inline my other types instead of importing them from my |
🐛 bug report
Using the new fix from #7424, I would have thought the types issue would have resolved my issue in #6815. However, the types generated result in broken import statements:
types.d.ts
As shown, the line
import { ReactNode as , ComponentType as } from "react";
has incomplete syntax (missing identifiers).🎛 Configuration (.babelrc, package.json, cli command)
package.json
.swcrc
🤔 Expected Behavior
I expect types to be generated correctly.
😯 Current Behavior
Types are not generated correctly.
💁 Possible Solution
Most likely will involve more fixes to
TSModuleGraph.js
🔦 Context
I'd like to generate types for downstream users of @jvanderen1/unstated-next.
💻 Code Sample
Github repository: https://github.com/jvanderen1/unstated-next
🌍 Your Environment
Note: These nightly builds do still contain an error originally demonstrated in #6815. To resolve, follow the following: #6815 (comment)
The text was updated successfully, but these errors were encountered: