Giter Site home page Giter Site logo

Comments (9)

darkbasic avatar darkbasic commented on July 22, 2024

angular/angular-cli#8086
Unfortunately this is a known issue with no solution yet. It seems that webpack does not honour externals when running tests.

from angularcli-meteor.

rgal75 avatar rgal75 commented on July 22, 2024

Having read angular/angular-cli#8086 I can see that the issue is about
Uncaught ReferenceError: Mongo is not defined.
I was able to overcome this by importing 'meteor-client' in test.ts.

I suspect that the issue I reported may have a different cause.

from angularcli-meteor.

rgal75 avatar rgal75 commented on July 22, 2024

It looks to me that Karma is still using AngularCli to build the tests instead of the ejected and modified webpack.config that has the

externals: [
        resolveExternals
    ]

configuration and as a result the tests cannot see the meteor/* modules.
What do you think?

from angularcli-meteor.

darkbasic avatar darkbasic commented on July 22, 2024

I'm not sure, but the Mongo error was definitely an oversight from my side.

from angularcli-meteor.

michaelb-01 avatar michaelb-01 commented on July 22, 2024

I'm getting the same error (though main.ts now has import 'meteor-client';)


 10% building modules 3/3 modules 0 activeProject is running at http://localhost:4200/
webpack output is served from /
404s will fallback to /index.html
Hash: 78794858705e820c1ae5                                                              
Version: webpack 3.6.0
Time: 11832ms
 10 assets
[./node_modules/@angular/core/@angular/core.es5.js] ./node_modules/@angular/core/@angular/core.es5.js 492 kB {vendor} [built]
[./node_modules/core-js/es7/reflect.js] ./node_modules/core-js/es7/reflect.js 510 bytes {polyfills} [built]
[./node_modules/loglevel/lib/loglevel.js] ./node_modules/loglevel/lib/loglevel.js 7.86 kB {inline} [built]
[./node_modules/webpack-dev-server/client/index.js?http://localhost:4200] (webpack)-dev-server/client?http://localhost:4200 5.83 kB {inline} [built]
[./node_modules/webpack/hot ^\.\/log$] (webpack)/hot nonrecursive ^\.\/log$ 170 bytes {inline} [built]
[./node_modules/webpack/hot/emitter.js] (webpack)/hot/emitter.js 77 bytes {inline} [built]
   [0] multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts 40 bytes {main} [built]
   [1] multi (webpack)-dev-server/client?http://localhost:4200 ./src/polyfills.ts 40 bytes {polyfills} [built]
[./node_modules/zone.js/dist/zone.js] ./node_modules/zone.js/dist/zone.js 126 kB {polyfills} [built]
[./src/app/app.module.ts] ./src/app/app.module.ts 1.11 kB {main} [built]
[./src/environments/environment.ts] ./src/environments/environment.ts 509 bytes {main} [built]
[./src/main.ts] ./src/main.ts 447 bytes {main} [built]
   [2] multi (webpack)-dev-server/client?http://localhost:4200 ./src/styles.scss 40 bytes {styles} [built]
[./src/polyfills.ts] ./src/polyfills.ts 2.52 kB {polyfills} [built]
[./src/styles.scss] ./src/styles.scss 1.24 kB {styles} [built]
    + 654 hidden modules

ERROR in ./src/main.ts
Module not found: Error: Can't resolve 'meteor-client' in '/Users/michaelbattcock/Documents/dev/apps/angularcli-meteor-master/src'
 @ ./src/main.ts 1:0-23
 @ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts
Child html-webpack-plugin for "index.html":
     1 asset
    [./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.html 352 bytes {0} [built]
webpack: Failed to compile.

from angularcli-meteor.

michaelb-01 avatar michaelb-01 commented on July 22, 2024

I've resolved the build error by doing npm install meteor-client

But now i'm getting:

vendor.bundle.js:67016 Uncaught ReferenceError: Mongo is not defined
    at new Collection (vendor.bundle.js:67016)
    at Object../api/server/collections/chats.ts (main.bundle.js:10)
    at __webpack_require__ (inline.bundle.js:55)
    at Object../api/server/collections/index.ts (main.bundle.js:19)
    at __webpack_require__ (inline.bundle.js:55)
    at Object../src/app/app.component.ts (main.bundle.js:89)
    at __webpack_require__ (inline.bundle.js:55)
    at Object../src/app/app.module.ts (main.bundle.js:133)
    at __webpack_require__ (inline.bundle.js:55)
    at Object../src/main.ts (main.bundle.js:191)

from angularcli-meteor.

darkbasic avatar darkbasic commented on July 22, 2024

Did you run npm run meteor-client:bundle?

from angularcli-meteor.

michaelb-01 avatar michaelb-01 commented on July 22, 2024

Sorry no I hand't, ignore me! It works now!

from angularcli-meteor.

janKir avatar janKir commented on July 22, 2024

I'm running into the same error. Is there a solution or workaround, yet?

Edit: I experience the error Error: Module not found: Error: Can't resolve 'meteor/meteor' as described above. I also experience this issue on a fresh clone of this repo. And I'm a little confused, that it seems to work for @michaelb-01 ?!

from angularcli-meteor.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.