Please provide us with the following information:
Windows 10
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
@angular/cli: 1.0.0-rc.1
node: 6.9.5
os: win32 x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
I moved the .angular-cli.json file to a higher folder and moved all the other folders to a client folder and changed all the corresponding changes to read from client folder.
Everything works fine like ng lint, ng build, ng e2e and ng serve.
But when running ng test, it fails with the below exception:
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
Uncaught ReferenceError: Zone is not defined
at webpack:///~/zone.js/dist/long-stack-trace-zone.js:77:0 <- src/test.ts:65482
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
Uncaught ReferenceError: Zone is not defined
at webpack:///~/zone.js/dist/long-stack-trace-zone.js:77:0 <- src/test.ts:65482
Normally this include a stack trace and some more information.
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
Uncaught ReferenceError: Zone is not defined
at webpack:/// ~/zone.js/dist/long-stack-trace-zone.js:77:0 <- src/test.ts:65482
Chrome 56.0.2924 (Windows 10 0.0.0) ERROR
Uncaught ReferenceError: Zone is not defined
at webpack:/// ~/zone.js/dist/long-stack-trace-zone.js:77:0 <- src/test.ts:65482
Can you please let me know if this is a issue with the CLI or I need to import zone.js elsewhere?
Thanks! We'll be in touch soon.
Sounds like you messed up some reference while moving. Probably polyfills related as it's needed for tests.
I'm closing because I don't see a CLI issue where, but rather something that broke from you moving stuff around.
It looks like the polyfills.ts file is not getting loaded before running the tests. Now sure why though, It's at the same place inside src folder and the root folder is changed to client/src in angular-cli.json file.
If I manually add those imports to tests.ts, ng test is working fine.
Anyways, I'm thinking twice about changing the folder structure. I would rather add server folder and add 'server.js' and 'routes/api.js' to serve the app using Express.
I've been following and adopting all the updates to Angular-CLI right from the beginning (even created new projects based on the latest version so that I don't miss out on any important updates). I've been updating my CLI (global and local) from beta 28 onwards. ng init is not there anymore for us to take the latest changes. Have to really on breaking changes only.
So, I took the latest CLI as of today and created a new project out of it to have a look at the structure. Looks like quite a bit has changed inside once again. So, I manually merged those changes to my existing project.
While doing this, I realised that earlier in main.ts, the polyfills.ts was imported in the first line. But, in the latest CLI, that import line is removed and with the minimum changes I made, I couldn't import the polyfills.ts before running tests.
So, reverted back to the original folder structure of the CLI. Hoping that there won't be further major changes in the next versions of the CLI that we have to create a new project and compare them side by side. Thank you.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Sounds like you messed up some reference while moving. Probably polyfills related as it's needed for tests.
I'm closing because I don't see a CLI issue where, but rather something that broke from you moving stuff around.