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

Unexpected identifier 'enableVueLoader' #74

Closed
bunkerskyi opened this issue Jul 1, 2017 · 3 comments
Closed

Unexpected identifier 'enableVueLoader' #74

bunkerskyi opened this issue Jul 1, 2017 · 3 comments

Comments

@bunkerskyi
Copy link

I start the Encore ./node_modules/.bin/encore dev and get this error:

/home/kribeetko/PhpstormProjects/ESUNZ/node_modules/@symfony/webpack-encore/index.js:378
enableVueLoader(vueLoaderOptionsCallback = () => {}) {
^^^^^^^^^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/kribeetko/PhpstormProjects/ESUNZ/webpack.config.js:1:76)

My webpack.config.js:

let Encore = require("@symfony/webpack-encore");

Encore
    .setOutputPath('web/build/')
    .setPublicPath('/build')
    .cleanupOutputBeforeBuild()
    .addEntry('scripts', './assets/app.js')
    .addStyleEntry('styles', './assets/app.scss')
    .enableVersioning()
    .enableSassLoader({
        resolve_url_loader: false
    })
    .enablePostCssLoader()
    .autoProvidejQuery()
    .autoProvideVariables({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery'
    })
    .configureBabel(function(babelConfig) {
        babelConfig.presets.push('es2017');
    })
    .enableSourceMaps(!Encore.isProduction());

module.exports = Encore.getWebpackConfig();
@hktr92
Copy link

hktr92 commented Jul 1, 2017

I encountered the issue, too. It's in the latest version of Encore (0.9.0). Symfony Demo uses 0.7.2 and it works without any issues.

screenshot_20170701_234253

that error log mentioned by npm:

0 info it worked if it ends with ok
1 verbose cli [ '/opt/nodejs/bin/node', '/opt/nodejs/bin/npm', 'run', 'dev' ]
2 info using npm@4.2.0
3 info using node@v7.9.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 silly lifecycle @~predev: no script for predev, continuing
7 info lifecycle @~dev: @
8 verbose lifecycle @~dev: unsafe-perm in lifecycle true
9 verbose lifecycle @~dev: PATH: /opt/nodejs/lib/node_modules/npm/bin/node-gyp-bin:/data/workspace/Projects/silvacms/themes/default/node_modules/.bin:/opt/a2box/bin:/opt/mcpanel/bin:/opt/nodejs/bin:/home/hktr92/.npm_modules/bin:/home/hktr92/.local/share/umake/bin:/home/hktr92/bin:/home/hktr92/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle @~dev: CWD: /data/workspace/Projects/silvacms/themes/default
11 silly lifecycle @~dev: Args: [ '-c', 'encore dev' ]
12 silly lifecycle @~dev: Returned: code: 1 signal: null
13 info lifecycle @~dev: Failed to exec dev script
14 verbose stack Error: @ dev: encore dev
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/opt/nodejs/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:194:7)
14 verbose stack at ChildProcess. (/opt/nodejs/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:194:7)
14 verbose stack at maybeClose (internal/child_process.js:899:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd /data/workspace/Projects/silvacms/themes/default
17 error Linux 4.4.0-81-generic
18 error argv "/opt/nodejs/bin/node" "/opt/nodejs/bin/npm" "run" "dev"
19 error node v7.9.0
20 error npm v4.2.0
21 error code ELIFECYCLE
22 error errno 1
23 error @ dev: encore dev
23 error Exit status 1
24 error Failed at the @ dev script 'encore dev'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error encore dev
24 error You can get information on how to open an issue for this project with:
24 error npm bugs
24 error Or if that isn't available, you can get their info via:
24 error npm owner ls
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

@gaiaz-iusipov
Copy link

gaiaz-iusipov commented Jul 1, 2017

You can fix it by yourself for now.

There are already fifth pull requests exist for this issue: #64, #67, #68, #69 and #70

@weaverryan
Copy link
Member

Sorry about that! Fixed in 0.9.1 (run yarn upgrade) and we updated CI to catch this in the future :).

Cheers!

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

No branches or pull requests

4 participants