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

Parser crashes on TypeScript inline type imports #96

Closed
Xunnamius opened this issue Dec 16, 2022 · 1 comment · Fixed by #97
Closed

Parser crashes on TypeScript inline type imports #96

Xunnamius opened this issue Dec 16, 2022 · 1 comment · Fixed by #97
Labels
bug Something isn't working

Comments

@Xunnamius
Copy link

Xunnamius commented Dec 16, 2022

I'm pretty sure this is the right place to create this issue, but if not let me know.

I'm trying to use vscode to debug some of my unit tests. One of my test files uses the relatively new inline type imports feature to condense imports:

import fs from 'node:fs';
import path from 'node:path';
import assert from 'node:assert';
import { EOL } from 'node:os';
import { isNativeError } from 'node:util/types';
import { declare } from '@babel/helper-plugin-utils';
import { asMockedFunction, type AnyFunction } from '@xunnamius/jest-types';
import babel from '@babel/core';

However, the Jest plugin for vscode crashes, giving me the following error as all IDE UI decorations disappear:

/repos/babel-plugin-tester/test/plugin-tester.test.ts: failed to parse test results: SyntaxError: Unexpected token, expected "," (7:32)

Removing the inline type annotation fixes it. Is this expected behavior (that is: am I missing a babel plugin or something)?

Thanks for reading!

@connectdotz
Copy link
Collaborator

connectdotz commented Dec 18, 2022

ok, I was able to reproduce this error. We need to upgrade the dependency of this library.

@connectdotz connectdotz added the bug Something isn't working label Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants