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

[build issue] Adding parsers that use nullish coalescing or optional chaining seems to break builds #718

Open
josh-hemphill opened this issue May 16, 2024 · 1 comment

Comments

@josh-hemphill
Copy link

Describe the bug
Trying to add Vue Language-Tools for the default block parsers that ships with Vue, but it seems to make use of optional chaining and nullish coalescing operators, which throws errors on build.

To Reproduce
Steps to reproduce the behavior:

  1. Build my feature fork or load any library using optional chaining or nullish coalescing: josh-hemphill/astexplorer
  2. See error

The full error:

ERROR in ./node_modules/@vue/language-core/lib/virtualFile/computedSfc.js 14:107
Module parse failed: Unexpected token (14:107)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|         return res;
|     };
>     const template = computedNullableSfcBlock('template', 'html', (0, computeds_1.computed)(() => parsed()?.descriptor.template ?? undefined), (_block, base) => {
|         const compiledAst = computedTemplateAst(base);
|         return mergeObject(base, {
 @ ./src/parsers/vue/vue-language-tools-core.js 26:4-37:6
 @ ./src/parsers sync ^\.\/(?!utils|transpilers)[^/]+\/(transformers\/([^/]+)\/)?(codeExample\.txt|[^/]+?\.js)$
 @ ./src/parsers/index.js
 @ ./src/store/reducers.js
 @ ./src/app.js
@IPWright83
Copy link

Just to voice I'm trying to build some stuff using optional chaining too and it means I can't easily switch between coding the babel plugin and testing it in AST Explorer which is a shame as it's so incredibly useful. So I'd also appreciate support for these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants