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

workbox-webpack-plugin has issues with node version 5 (v5.7.0) #950

Closed
pskanawat opened this issue Oct 30, 2017 · 6 comments
Closed

workbox-webpack-plugin has issues with node version 5 (v5.7.0) #950

pskanawat opened this issue Oct 30, 2017 · 6 comments

Comments

@pskanawat
Copy link

Library Affected:
workbox-webpack-plugin

Browser & Platform:
node v5.7.0

Issue or Feature Request Description:
Due to missing use script in webpack plugin, it fails in node v5.

Console logs

1

`class WorkboxBuildWebpackPlugin {
^^^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/Users/puran.kanawat/dev/sp-seller-dashboard/client/webpack.config.js:13:23)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)`

2

`const {publicPath} = compilation.options.output;
^

SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/Users/puran.kanawat/dev/sp-seller-dashboard/client/webpack.config.js:13:23)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)`

@gauntface
Copy link

Thanks for raising the issue.

We need to find a way to run the node modules on older versions of Node to avoid this issue in the future,

@jeffposnick
Copy link
Contributor

The approach in v3 is to run things through babel-preset-env with a Node 4 target. This should not be an issue moving forward once v3 is released.

We didn't backport that transpilation to v2.

@jeffposnick
Copy link
Contributor

@pskanawat If this is blocking your work, we can publish another release in the v2 branch that manually adds the use strict; (This would likely happen on Thursday, our next scheduled release date.)

Alternatively, if you could update from Node 5 to a more recent version, that would address it sooner. (And as mentioned, this will stop being an issue with our v3 releases of Workbox in general.)

@pskanawat
Copy link
Author

@jeffposnick Surely, I would like to move to the recent version of Node but that is going to take its own sweet time.

It would be great if you can publish another release with following fixes

  1. Adding 'use strict'
  2. Fixing second error via changing "const {publicPath}" to "const publicPath = compilation.options.output.publicPath;"

@jeffposnick
Copy link
Contributor

Okay, we should be able to get that out in a v2 patch release on Thursday.

@jeffposnick
Copy link
Contributor

The updated workbox-webpack-plugin is published as part of https://github.com/GoogleChrome/workbox/releases/tag/v2.1.1

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

No branches or pull requests

3 participants