-
-
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
[@parcel/transformer-typescript-types]: Meaningless "Got unexpected undefined" error message #7669
Comments
With the debugger, it looks like here is the node remains undefined. |
I also ran into this issue recently although slightly different
the modifiers on the node in my case was undefined and I have found that this is only introduced when you have a typescript version >= 4.6.0. @jakubmazanec I notice you have This does however not explain the problem since that is a minor version bump of TS and I would have expected a library depending on that to not be affected. If it is, then I think this lib needs a strict version associated to prevent this issue until the code causing the error is updated with the newer version of TS. |
@rathpc I reported this 2 months ago, when TypeScript 4.6 wasn't released yet. But I'll try anyway. |
I installed and run the repo with TypeScript 4.6.3 and also with TypeScript 4.5.5, same error. Best if somebody took a look at that PR... |
Ah ok, thanks for testing my theory at least! |
I got the same error. Don't know is it the same bug or not, but I figured out the following:
// index.ts
import { FC } from "react";
// index.ts
export type MyComponent = FC<{}>;
// react.ts
export default "";
// index.ts
import { FC } from "react";
// @parcel/transformer-typescript-types: Got unexpected undefined
import {} from "./react";
export type MyComponent = FC<{}>; It also works with other modules. React is just an example. Versions:
Repo with reproduction: https://github.com/alexgraddev/parcel2-typescript-types-bug |
Would also appreciate a fix for this! |
Also looks like there's something with index re-exports this doesn't work: // src/index.ts
import { customTheme } from './themes'
// src/themes/index.ts
export * from './customTheme'
// src/themes/customTheme.ts
export const customTheme = ... this works: // src/index.ts
import { customTheme } from './themes/customTheme'
// src/themes/index.ts
export * from './customTheme'
// src/themes/customTheme.ts
export const customTheme = ... |
I had the same problem that was mentioned here #7669 (comment), and found another issue when renaming it.
It seems like leading |
I'm having the same problem. Here is a reproducible repo. Would love if this could get resolved, or if anyone has any solutions. Thanks! |
I'm still seeing this every now and then, don't think it has been resolved |
I updated all dependencies in the repo with the bug reproduction; the bug still exists. |
I updated Parcel and TypeScript in the repo with the bug reproduction; the bug still exists. |
I assume this is still not fixed? |
I encountered "Got unexpected undefined" error. I don't know what exactly causes it, but I created repo with minimal reproduction.
🎛 Configuration
package.json
tsconfig.json
Source code:
🤔 Expected Behavior
Parcel builds with no error? I think this minimal reproduction shouldn't actually build (because of e.g. missing React), but the errors should be more descriptive and useful.
😯 Current Behavior
Parcel errors:
💻 Code Sample
Repo with reproduction. Clone and run
npm install
andnpm run build
.🌍 Your Environment
The text was updated successfully, but these errors were encountered: