nsrosenqvist / gulp-single-file-components

A Gulp plugin that let's you build single file components (as made famous by Vue) and use them in other environments by splitting the vue-files into separate files.
MIT License
6 stars 3 forks source link

[PARTIALLY SOLVED] UnhandledPromiseRejectionWarning #2

Open ZzEeKkAa opened 6 years ago

ZzEeKkAa commented 6 years ago

Hi, I'm trying to run the sample from the doc, but have an error. Please help case it does exactly what i need. Thanks

$ npm i gulp --save-dev gulp-single-file-components           
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated natives@1.1.3: This module relies on Node.js\'s internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌
npm WARN npm-test@1.0.0 No description
npm WARN npm-test@1.0.0 No repository field.

+ gulp-single-file-components@1.0.3
+ gulp@3.9.1
updated 2 packages in 12.463s
$ gulp components
[21:46:21] Using gulpfile ~/npm-test/gulpfile.js
[21:46:21] Starting 'components'...
(node:9701) UnhandledPromiseRejectionWarning
(node:9701) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9701) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

But if there is no .vue file's everything is ok =)

$ npm run gulp components

> npm-test@1.0.0 gulp /home/zeka/npm-test
> ./node_modules/gulp/bin/gulp.js "components"

[21:39:23] Using gulpfile ~/npm-test/gulpfile.js
[21:39:23] Starting 'components'...
[21:39:23] Finished 'components' after 7.67 ms

Might be helpful

$ npm --version
6.0.0

Update:

I've updated gulp to 4.0.0 and then, magic, it told what I need to do:
```bash
[20:41:41] Error in plugin 'gulp-single-file-components'
Message:
    In file components/test.vue:
You are trying to use "babel". babel-preset-es2015 and babel-plugin-transform-runtime are missing.

To install run:
npm install --save-dev babel-preset-es2015 babel-plugin-transform-runtime
Details:
    domainEmitter: [object Object]
    domain: [object Object]
    domainThrown: false
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! npm-test@1.0.0 gulp: `./node_modules/gulp/bin/gulp.js "components"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the npm-test@1.0.0 gulp 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/zeka/.npm/_logs/2018-05-06T17_41_41_898Z-debug.log

So, after I installed components npm install --save-dev babel-preset-es2015 babel-plugin-transform-runtime then everything built. Even when I downgraded to 3.9.1.

So the problem is that built in npm helper doesn't work with 3.9.1

nsrosenqvist commented 6 years ago

Hmm, seems like a missing dependency issue. Thanks! I'll look into it