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: Unexpected token { #10062

Open
vonwao opened this issue Jun 5, 2019 · 5 comments

Comments

Projects
None yet
4 participants
@vonwao
Copy link

commented Jun 5, 2019

Bug Report

Current Behavior
Get error:
(function (exports, require, module, __filename, __dirname) { import { addLike } from "./streamHelpers";
^SyntaxError: Unexpected token {

Babel Configuration (.babelrc, package.json, cli command)

"presets": ["@babel/env"]

Environment
Babel version(s):
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/node": "^7.4.5",
"@babel/preset-env": "^7.4.5",
Node/npm version: [e.g. Node 8/npm 5]
v10.15.1
OS: [e.g. OSX 10.13.4, Windows 10]
Win10 and Mac OSX

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Jun 5, 2019

Hey @vonwao! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@nicolo-ribaudo

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

How are you running Babel, what is your directory structure and which file is throwing?

PS. Using babel.config.js instead of .babelrc might fix it.

@vonwao

This comment has been minimized.

Copy link
Author

commented Jun 6, 2019

I was running with yarn
"build": "babel -d ./build ./src -s",
"start": "node ./build/main/server.js",

The file that was throwing was not the entry point, but another random file.

@existentialism

This comment has been minimized.

Copy link
Member

commented Jun 6, 2019

Any chance you create a small repo that reproduces the error?

@babel-bot

This comment has been minimized.

Copy link
Collaborator

commented Jun 9, 2019

Hi @vonwao! A maintainer of the project has notified me that you're missing
some information we'll need to replicate this issue.

Please understand that we receive a high volume of issues, and there are only a limited number
of volunteers that help maintain this project. The easier it is for us to decipher an issue with the info provided,
the more likely it is that we'll be able to help.

Please make sure you have the following information documented in this ticket:

  1. Your Babel configuration (typically in the form of a .babelrc)
  2. The current (incorrect) behavior you're seeing
  3. The behavior you expect
  4. A short, self-contained example

Please provide either a link to the problem via the repl, or if the repl is insufficient,
a new and minimal repository with instructions on how to build/replicate the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.