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

Fix CI builds (Karma + PhantomJS) #4252

Closed
bajtos opened this issue Sep 12, 2019 · 4 comments · Fixed by #4262
Assignees
Labels

Comments

@bajtos
Copy link
Member

@bajtos bajtos commented Sep 12, 2019

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.

@bajtos bajtos added bug ci labels Sep 12, 2019
@bajtos

This comment has been minimized.

Copy link
Member Author

@bajtos bajtos commented Sep 12, 2019

Strangely enough, I am not able to reproduce this problem on my local machine :(

@dhmlau

This comment has been minimized.

Copy link
Contributor

@dhmlau dhmlau commented Sep 13, 2019

@bajtos, if that's the case, do you want to try to reproduce it first or I can go ahead for estimation? Thanks.

@bajtos

This comment has been minimized.

Copy link
Member Author

@bajtos bajtos commented Sep 27, 2019

I think I had outdated node_modules in my local git clone. After removing the directory and installing the latest versions of all dependencies, I am able to reproduce the problem locally too.

@bajtos bajtos self-assigned this Sep 27, 2019
@bajtos bajtos mentioned this issue Sep 30, 2019
2 of 2 tasks complete
@bajtos

This comment has been minimized.

Copy link
Member Author

@bajtos bajtos commented Sep 30, 2019

See #4262

@agnes512 agnes512 mentioned this issue Sep 30, 2019
18 of 25 tasks complete
@emonddr emonddr added this to the Oct 2019 milestone milestone Oct 1, 2019
@bajtos bajtos closed this in #4262 Oct 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.