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

[loader] Add "use strict" or document node 6 requirement #39

Closed
pward123 opened this issue Jan 25, 2017 · 3 comments
Closed

[loader] Add "use strict" or document node 6 requirement #39

pward123 opened this issue Jan 25, 2017 · 3 comments
Labels

Comments

@pward123
Copy link

I get the following error when using the loader in webpack 2 with node 4.6.1:

Module build failed: SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

This can be fixed by adding "use strict"; to the top of loader.js or switching to node 6. I'm not sure if you want to add strict mode or document the requirement.

@jnwng
Copy link
Contributor

jnwng commented Jan 26, 2017

there's nothing in the webpack loader that would necessitate a hard dependency on node 6, so i would hesitate to suggest enforcing that.

there's a couple of solutions here:

  1. compile down the loader code ala babel-loader which would future-proof this particular module
  2. just change the let statement to a var statement or add the use strict; directive you mentioned.

while i'd prefer that we do the former (compiling the loader), i'd be happy to accept a PR with the latter (adding use strict; or changing the let statement) in the meantime.

@jnwng jnwng added the easy label Jan 26, 2017
@jnwng
Copy link
Contributor

jnwng commented Jan 26, 2017

linking with #32 as i suspect this will be something to address when the webpack loader is extracted

pward123 added a commit to pward123/graphql-tag that referenced this issue Jan 26, 2017
Added 'use strict'; to loader.js in order to fix apollographql#39
jnwng added a commit that referenced this issue Jan 31, 2017
added use strict; to fix issue #39
@jnwng
Copy link
Contributor

jnwng commented Jan 31, 2017

addressed by #41. @pward123 unfortunately didn't see that you had created this in your fork, in the future you can send a pull request so that we can pull your code back into this repository.

@jnwng jnwng closed this as completed Jan 31, 2017
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