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

Syntax error when filename contains invalid character #12

Open
jstcki opened this issue Apr 20, 2017 · 1 comment
Open

Syntax error when filename contains invalid character #12

jstcki opened this issue Apr 20, 2017 · 1 comment
Labels

Comments

@jstcki
Copy link

jstcki commented Apr 20, 2017

I stumbled upon this when using it with next.js.

Next.js sometimes tries to compile pages with the suffix ?entry which results in this error:

 error  in ./pages/foo?entry

Syntax Error: Unexpected token, expected ; (6:11)
  4 | import Link from "next/dist/lib/link.js";
  5 |
> 6 | var indexJs?entry = function indexJsEntry() {
    |            ^
  7 |   return React.createElement(
  8 |     "div",
  9 |     {

(/pages/foo is a directory with an index.js file)

As you see, the function name is correct but the var name still contains the ?.

I think the ideal behavior would be to strip the ?entry completely, so the function name would correctly resolve to the parent directory name.

@gajus gajus added the bug label Apr 20, 2017
@gajus
Copy link
Owner

gajus commented Apr 20, 2017

Looks like a bug/ deficiency. Would accept a PR.

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

No branches or pull requests

2 participants