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

Newer Angular 4.3.5 throws errors with sample #22

Closed
mattmutt opened this issue Aug 20, 2017 · 5 comments
Closed

Newer Angular 4.3.5 throws errors with sample #22

mattmutt opened this issue Aug 20, 2017 · 5 comments

Comments

@mattmutt
Copy link

"@angular/core": "^4.0.0",

Are others seeing errors with a clean install of this sample Wallaby project?

I see in the Wallaby Console in Webstorm
TypeError: useValue,useFactory,data is not iterable!

TypeError: undefined is not a constructor (evaluating 'Object.assign({ changeDetection: ChangeDetectionStrategy.Default }, c)')

I would highly recommend supplying shrinkwrap JSON to avoid installations from blowing up for others.

Reverting dependencies and devDependencies to earlier versions of Angular 4.1 or 4.2 eliminate the runtime errors.

On a side note, will the Angular Webpack version work? I had zero luck, probably due to same problems with semver values in package.json being too loose or outdated.

Others are suffering from this problem
karma-runner/karma-phantomjs-launcher#205

@ArtemGovorov
Copy link
Member

Are others seeing errors with a clean install of this sample Wallaby project?

Will try it now, however the latest angular-cli (that is used to generate this sample repo) is only generating the package.json file with @angular/core v^4.2.4.

I would highly recommend supplying shrinkwrap JSON to avoid installations from blowing up for others.

package-lock.json is actually supplied in this repo. Or do you mean something else?

On a side note, will the Angular Webpack version work? I had zero luck, probably due to same problems with semver values in package.json being too loose or outdated.

Not sure what you mean by "Angular Webpack version"?

@ArtemGovorov
Copy link
Member

Just checked and everything has worked for me without any issues. I have also updated this repo to be generated from the latest angular-cli (1.3.1).

After running npm install for this repo, the installed Angular version is 4.3.5.

The errors that you're observing:

TypeError: useValue,useFactory,data is not iterable!

TypeError: undefined is not a constructor (evaluating 'Object.assign({ changeDetection: ChangeDetectionStrategy.Default }, c)')

are PhantomJs specific. It means that you are using PhantomJs in your wallaby config (not the default Electron runner as in this repo config), and if you are using PhantomJs, them you need to uncomment polyfills as described in the README file:

You may use PhantomJs runner if you like, to do that you may just remove the env setting. In this case, you will not need to npm i electron (and can remove electron from the package.json dependencies), however will need to uncomment core-js polyfills and Intl polyfill, so that PhantomJs may work.

specifically various core-js polyfills required for PhantomJs to function correctly.

I think the same applies to issue that you've referenced:

Others are suffering from this problem
karma-runner/karma-phantomjs-launcher#205

Try cloning this repo latest version, running npm install and running tests. If it works for you, juts update your project's wallaby config to use electron (or uncomment required polyfills in you'd like to keep using PhantomJs).

Let me know if it works for you.

@mattmutt
Copy link
Author

thank you for the rapid turn around. What i meant is that if a npm-shrinkwrap.json were bundled in this repo, then you would have the ability to lock down and prevent things like ^4.0.0 which it was set to in the prior version from being too eager. On a fresh npm install, I would have downloaded Angular 4.3.5, since that matches that and unfortunately breaks.

I was wondering if you could recommend a working Angular 4 and Webpack starter. I did try out https://github.com/wallabyjs/angular2-webpack-starter , but that didn't work. Yes, I understand that repo is geared toward Angular 2.

@ArtemGovorov
Copy link
Member

What i meant is that if a npm-shrinkwrap.json were bundled in this repo

package-lock.json is supplied in this repo and is supposed to do it.

I would have downloaded Angular 4.3.5, since that matches that and unfortunately breaks.

I wasn't able to reproduce the issue and can't reproduce it now. As I have mentioned, the errors you've listed must be occurring because PhantomJs is used without required polyfills (at least it's the only way I can even get those errors).

Try the cloning latest version of this repo and running npm install, it should work.

I was wondering if you could recommend a working Angular 4 and Webpack starter. I did try out https://github.com/wallabyjs/angular2-webpack-starter , but that didn't work. Yes, I understand that repo is geared toward Angular 2.

Yep, that repo was created a while ago. Looks like the starter file structure had changed a bit since then. I'll update that sample project's config and let you know once it's ready.

@ArtemGovorov
Copy link
Member

I was wondering if you could recommend a working Angular 4 and Webpack starter. I did try out https://github.com/wallabyjs/angular2-webpack-starter , but that didn't work. Yes, I understand that repo is geared toward Angular 2.

As promised, I have updated our sample. You may find the updated sample (and the instructions how to run wallaby in the project's readme file) in this repo: https://github.com/wallabyjs/angular-starter.

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

2 participants