EvanAgee / vuejs-wordpress-theme-starter

A WordPress theme with the guts ripped out and replaced with Vue.
https://vuewp.com/
1.6k stars 281 forks source link

"SyntaxError: Block-scoped declarations not yet supported outside strict mode" #15

Closed kucharzgotuje closed 6 years ago

kucharzgotuje commented 6 years ago

Hi guys,

So I've downloaded fresh copy of this theme, started as Mr. Readme said, and I ran into this error doing

npm run watch

Installation went well exept for two warnings:

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg= integrity checksum failed when using sha1: wanted sha1-+PLIh60Qv2f2NPAFtph/7TF5qsg= but got sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==. (2301 bytes)

npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

Entire error looks like this:

> @ watch /var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite
> node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

/var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite/node_modules/laravel-mix/setup/webpack.config.js:24
let WebpackConfig = require('../src/builder/WebpackConfig');
^^^

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:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at requireConfig (/var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite/node_modules/webpack/bin/convert-argv.js:97:18)
    at /var/www/vhosts/mysite.local/wordpress/wp-content/themes/mysite/node_modules/webpack/bin/convert-argv.js:104:17
    at Array.forEach (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/user/.npm/_logs/2018-02-18T13_33_30_936Z-debug.log

.log file says prints the same.

Steps do reproduce this issue:

having ubuntu 14.04 npm 5.6.0 download zip, unpack & run.

Anyone else had this problem?

EvanAgee commented 6 years ago

Hi @kucharzgotuje! Sorry you're running into this issue. Can you confirm for me that you ran npm install?

kucharzgotuje commented 6 years ago

Yes, 100% sure.

kucharzgotuje commented 6 years ago

Hi there @EvanAgee, I've manage to run this template inside docker container ( php7, ubuntu 16.04 ) but still I had to do full npm dependencies update, so previous issue had to do something with my local configuration. I ran

npm i -g npm-check-updates
ncu -u
npm install 

And still nothing. Nevermind though, it's started like a charm inside container. But another wild issue has appeared: recent posts & pages list aren't rendering on front-end although wp-json is working well.

wester97 commented 6 years ago

Hmm, please pull master and try again.

kucharzgotuje commented 6 years ago

I've pulled master inside docker container where all worked. Got

The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D

After installing webpack-cli:

(...)
npm ERR! Linux 4.4.0-116-generic
npm ERR! argv "/usr/local/bin/node" "/usr/bin/npm" "run" "watch"
npm ERR! node v9.6.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ watch: `node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ watch script 'node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
(...)

After pulling master I've removed node_modules & npm install again. Outside container on my local machine it's still the same.

EvanAgee commented 6 years ago

@kucharzgotuje did you get this solved? I just looked over this thread again and it looks as though you're using webpack 4, can you confirm?