-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix CI builds (Karma + PhantomJS) #4252
Description
At the moment, npm test is failing in this repository. As a result, it's difficult to land pull requests with confidence.
ERROR [framework.browserify]: bundle error
ERROR [framework.browserify]: Error: Couldn't find preset "@babel/preset-env"
relative to directory "/home/travis/build/strongloop/loopback/node_modules/loopback-connector/node_modules/async/dist"
while parsing file: /home/travis/build/strongloop/loopback/node_modules/loopback-connector/node_modules/async/dist/async.js
Possible directions to investigate:
- Upgrade Karma & plugins to their latest versions
- Check Babel configuration
- Replace PhantomJS with Headless Chrome, perhaps remove Babel from the setup too
Full log
Running "run:optionalInstall" (run) task
Considering PhantomJS found at /usr/local/bin/phantomjs
Found PhantomJS at /usr/local/bin/phantomjs ...verifying
Writing location.js file
PhantomJS is already installed on PATH at /usr/local/bin/phantomjs
+ karma-phantomjs-launcher@1.0.4
+ phantomjs-prebuilt@2.1.16
added 15 packages from 35 contributors in 11.778s
Running "karma:unit-once" (karma) task
[BABEL] Note: The code generator has deoptimised the styling of "/home/travis/build/strongloop/loopback/node_modules/lodash/lodash.js" as it exceeds the max of "500KB".
09 08 2019 09:35:06.313:ERROR [framework.browserify]: bundle error
09 08 2019 09:35:06.316:ERROR [framework.browserify]: Error: Couldn't find preset "@babel/preset-env" relative to directory "/home/travis/build/strongloop/loopback/node_modules/loopback-connector/node_modules/async/dist" while parsing file: /home/travis/build/strongloop/loopback/node_modules/loopback-connector/node_modules/async/dist/async.js
09 08 2019 09:35:06.413:INFO [karma-server]: Karma v4.2.0 server started at http://0.0.0.0:9876/
09 08 2019 09:35:06.414:INFO [launcher]: Launching browsers PhantomJS with concurrency unlimited
09 08 2019 09:35:06.417:INFO [launcher]: Starting browser PhantomJS
09 08 2019 09:35:10.642:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket XkEOlZnG3xq3qu2HAAAA with id 16887580
[BABEL] Note: The code generator has deoptimised the styling of "/home/travis/build/strongloop/loopback/node_modules/@sinonjs/text-encoding/lib/encoding-indexes.js" as it exceeds the max of "500KB".
PhantomJS 2.1.1 (Linux 0.0.0) ERROR
Error: bundle error (see logs)
at /tmp/c2c20d926257fc7a9a690e2da3a7e580.browserify.js:1:43
PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 0 ERROR (22.23 secs / 0 secs)
Warning: Task "karma:unit-once" failed. Use --force to continue.