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

SyntaxError: Missing initializer in const declaration. (1:16) #1219

Closed
NullVoxPopuli opened this issue Apr 30, 2022 · 1 comment
Closed

SyntaxError: Missing initializer in const declaration. (1:16) #1219

NullVoxPopuli opened this issue Apr 30, 2022 · 1 comment

Comments

@NullVoxPopuli
Copy link

NullVoxPopuli commented Apr 30, 2022

Describe the bug

I get this error:

SyntaxError: Missing initializer in const declaration. (1:16)
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:72:32
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:358:12
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:3335:19
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:15273:16
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:15066:10
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:10226:31
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:14608:21
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:10267:18
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:14533:17
 - /node_modules/.pnpm/@[email protected]/node_modules/@babel/parser/lib/index.js:15913:17

I am testing with babel plugins

Reproduction

this repo:
NullVoxPopuli/svg-icon-optimizer#1
branch: embroider-safe-limber-experiment

run pnpm exec vitest

this isn't minimally reproducible, but I find it goofy that the error is coming from@babel/parser -- because in a normal node environment this issue does not present itself.

System Info

System:
    OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 13.57 GB / 31.14 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 16.15.0 - ~/.volta/tools/image/node/16.15.0/bin/node
    Yarn: 1.22.11 - ~/.volta/tools/image/yarn/1.22.11/bin/yarn
    npm: 8.5.5 - ~/.volta/tools/image/node/16.15.0/bin/npm
  Browsers:
    Chrome: 101.0.4951.41
    Firefox: 99.0.1
  npmPackages:
    vitest: ^0.10.0 => 0.10.0 



### Used Package Manager

pnpm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/vitest-dev/vitest/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://vitest.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/vitest-dev/vitest/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/vitest-dev/vitest/discussions) or join our [Discord Chat Server](https://chat.vitest.dev).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.
@NullVoxPopuli
Copy link
Author

in my case, if I just ignore support for "the older syntax" (don't worry about, it's only important for what I'm doing), I don't need to worry about this problem 😅

So, I guess this code path only occurs while trying to parse template literals.

chaii3 pushed a commit to chaii3/vitest that referenced this issue May 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant